diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-23 08:01:29 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-23 08:01:29 -0400 |
commit | 0f3478ca5a3e6ba224d61bbde452d4bc319e40f8 (patch) | |
tree | 7e5ef51b7edd71fadb1e9a1b58ad0d8a024fc722 | |
parent | Add the little emblem/overlay on desktop icons which are actually symbolic li... (diff) | |
download | lumina-0f3478ca5a3e6ba224d61bbde452d4bc319e40f8.tar.gz lumina-0f3478ca5a3e6ba224d61bbde452d4bc319e40f8.tar.bz2 lumina-0f3478ca5a3e6ba224d61bbde452d4bc319e40f8.zip |
Also add the symbolic link emblem overlay to the items in the desktopview plugin.
-rw-r--r-- | lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index d81afd1e..01e174e9 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -170,6 +170,15 @@ void DesktopViewPlugin::updateContents(){ it->setIcon( LXDG::findMimeIcon( files[i].fileName() ) ); txt = files[i].fileName(); } + //Add the sym-link overlay to the icon as necessary + if(files[i].isSymLink()){ + QImage img = it->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 + it->setIcon( QIcon(QPixmap::fromImage(img)) ); + } //Now adjust the visible text as necessary based on font/grid sizing it->setToolTip(txt); if(this->fontMetrics().width(txt) > (gridSZ.width()-4) ){ |