diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-23 07:56:23 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-23 07:56:23 -0400 |
commit | 06c474e2147ed77d060973fc136f27bb108d8670 (patch) | |
tree | ada5eb3fc06f4e341820afa63b64c9e9c62d380c /lumina-desktop/desktop-plugins | |
parent | Enable the vertical scrollbar for the favorites list in the start menu as nee... (diff) | |
download | lumina-06c474e2147ed77d060973fc136f27bb108d8670.tar.gz lumina-06c474e2147ed77d060973fc136f27bb108d8670.tar.bz2 lumina-06c474e2147ed77d060973fc136f27bb108d8670.zip |
Add the little emblem/overlay on desktop icons which are actually symbolic links.
Diffstat (limited to 'lumina-desktop/desktop-plugins')
-rw-r--r-- | lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index 40eca47e..926c6fb6 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -71,6 +71,15 @@ void AppLauncherPlugin::loadButton(){ button->setText( tr("Click to Set") ); if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); } } + //If the file is a symlink, put the overlay on the icon + if(QFileInfo(path).isSymLink()){ + QImage img = button->icon().pixmap(QSize(icosize,icosize)).toImage(); + int oSize = icosize/2; //overlay size + QPixmap overlay = LXDG::findIcon("emblem-symbolic-link").pixmap(oSize,oSize).scaled(oSize,oSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); + QPainter painter(&img); + painter.drawPixmap(icosize-oSize,icosize-oSize,overlay); //put it in the bottom-right corner + button->setIcon( QIcon(QPixmap::fromImage(img)) ); + } //Now adjust the visible text as necessary based on font/grid sizing button->setToolTip(txt); //Double check that the visual icon size matches the requested size - otherwise upscale the icon |