diff options
Diffstat (limited to 'lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp')
-rw-r--r-- | lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index 0aa4a3de..273f1958 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -4,6 +4,7 @@ #include <QDir> #include <QClipboard> #include <QMimeData> +#include <QImageReader> #include <LuminaXDG.h> #include "LSession.h" @@ -126,6 +127,10 @@ void DesktopViewPlugin::decreaseIconSize(){ void DesktopViewPlugin::updateContents(){ list->clear(); + if(imgExtensions.isEmpty()){ + QList<QByteArray> fmt = QImageReader::supportedImageFormats(); + for(int i=0; i<fmt.length(); i++){ imgExtensions << QString::fromLocal8Bit(fmt[i]); } + } int icosize = settings->value("IconSize",64).toInt(); list->setGridSize(QSize(icosize+8,icosize+4+this->fontMetrics().height())); QDir dir(QDir::homePath()+"/Desktop"); @@ -151,6 +156,9 @@ void DesktopViewPlugin::updateContents(){ it->setIcon( LXDG::findMimeIcon(files[i].fileName()) ); it->setText( files[i].fileName() ); } + }else if(imgExtensions.contains(files[i].suffix().toLower()) ){ + it->setIcon( QIcon( QPixmap(files[i].absoluteFilePath()).scaled(icosize,icosize,Qt::IgnoreAspectRatio, Qt::SmoothTransformation) ) ); + it->setText( files[i].fileName() ); }else{ it->setIcon( LXDG::findMimeIcon( files[i].fileName() ) ); it->setText( files[i].fileName() ); |