From 06c474e2147ed77d060973fc136f27bb108d8670 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 23 Oct 2015 07:56:23 -0400 Subject: Add the little emblem/overlay on desktop icons which are actually symbolic links. --- lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lumina-desktop/desktop-plugins') 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 -- cgit