From d0fb463abb9e79606c9eb75b3a94331127cd5060 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 28 May 2015 09:56:15 -0400 Subject: Add a new LUtils::imageExtensions() function, and setup the lumina-desktop plugins to all use that for checking whether a thumbnail can be shown. Also add thumbnail support into the user button for favorite files. --- lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp') diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp index 4a274cdf..1cceb5e2 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp @@ -33,7 +33,11 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type, } }else{ if(itemPath.endsWith("/")){ itemPath.chop(1); } - icon->setPixmap( LXDG::findMimeIcon(type).pixmap(32,32) ); + if(LUtils::imageExtensions().contains(itemPath.section("/",-1).section(".",-1).toLower()) ){ + icon->setPixmap( QIcon(itemPath).pixmap(32,32) ); + }else{ + icon->setPixmap( LXDG::findMimeIcon(type).pixmap(32,32) ); + } name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) ); } icon->setWhatsThis(itemPath); @@ -123,6 +127,9 @@ void UserItemWidget::setupButton(bool disable){ //This already has a desktop shortcut -- no special actions button->setVisible(false); } + if(isShortcut){ + name->setToolTip(icon->whatsThis()); //also allow the user to see the full shortcut path + } } void UserItemWidget::buttonClicked(){ -- cgit