aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-02-24 13:11:35 -0500
committerKen Moore <ken@ixsystems.com>2017-02-24 13:11:35 -0500
commitb28fb3902d2435f1e60dfed2196f90378f56bcbd (patch)
tree17a9bea22a42b006deca1216086c20bf1cabcd80 /src-qt5/core
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-b28fb3902d2435f1e60dfed2196f90378f56bcbd.tar.gz
lumina-b28fb3902d2435f1e60dfed2196f90378f56bcbd.tar.bz2
lumina-b28fb3902d2435f1e60dfed2196f90378f56bcbd.zip
Make sure the tooltip on the desktop icons is properly set for .desktop entries (comment field).
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index c8ecf2c8..1d957817 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -38,6 +38,7 @@ void AppLauncherPlugin::loadButton(){
int icosize = this->height()-4 - 2.2*button->fontMetrics().height();
button->setFixedSize( this->width()-4, this->height()-4);
button->setIconSize( QSize(icosize,icosize) );
+ button->setToolTip("");
QString txt;
if(path.endsWith(".desktop") && ok){
XDGDesktop file(path);
@@ -50,6 +51,7 @@ void AppLauncherPlugin::loadButton(){
}else{
button->setWhatsThis(file.filePath);
button->setIcon( QIcon(LXDG::findIcon(file.icon,"system-run").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
+ if(!file.comment.isEmpty()){button->setWhatsThis(file.comment); }
txt = file.name;
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
watcher->addPath(file.filePath); //make sure to update this shortcut if the file changes
@@ -90,7 +92,7 @@ void AppLauncherPlugin::loadButton(){
button->setIcon( QIcon(QPixmap::fromImage(img)) );
}
//Now adjust the visible text as necessary based on font/grid sizing
- button->setToolTip(txt);
+ if(button->tooltip().isEmpty()){ button->setToolTip(txt); }
//Double check that the visual icon size matches the requested size - otherwise upscale the icon
if(button->fontMetrics().width(txt) > (button->width()-OUTMARGIN) ){
//Text too long, try to show it on two lines
bgstack15