aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-10-27 15:03:38 -0400
committerKen Moore <ken@pcbsd.org>2014-10-27 15:03:38 -0400
commit9482acb96095a6e6c236a72f60995e43d590b75f (patch)
treef9d5c13c04e69b61bb19107c154d7df2518918d6 /lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
parentAdd a new menu plugin: (diff)
downloadlumina-9482acb96095a6e6c236a72f60995e43d590b75f.tar.gz
lumina-9482acb96095a6e6c236a72f60995e43d590b75f.tar.bz2
lumina-9482acb96095a6e6c236a72f60995e43d590b75f.zip
Make sure to put a max length on the text in the user button items (180 pixels - auto-scale does not work unless the widget is visible). Also remove the custom stylesheet for the systemwindow (so it uses the theme).
Also start working on the new desktopview plugin (not integrated yet)
Diffstat (limited to 'lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index d1e35522..7a1983d2 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -14,10 +14,10 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, bool isDir, bo
XDGDesktop item = LXDG::loadDesktopFile(itemPath, ok);
if(ok){
icon->setPixmap( LXDG::findIcon(item.icon, "preferences-system-windows-actions").pixmap(30,30) );
- name->setText( item.name );
+ name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) );
}else{
icon->setPixmap( LXDG::findIcon("unknown","").pixmap(30,30) );
- name->setText( itemPath.section("/",-1) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
}
}else if(isDir){
if(itemPath.endsWith("/")){ itemPath.chop(1); }
@@ -26,12 +26,12 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, bool isDir, bo
name->setText( tr("Go Back") );
}else{
icon->setPixmap( LXDG::findIcon("folder","").pixmap(30,30) );
- name->setText( itemPath.section("/",-1) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
}
}else{
if(itemPath.endsWith("/")){ itemPath.chop(1); }
icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1).section(".",-1)).pixmap(30,30) );
- name->setText( itemPath.section("/",-1) );
+ name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) );
}
linkPath = QFile::symLinkTarget(itemPath);
icon->setWhatsThis(itemPath);
@@ -49,7 +49,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent
isShortcut = item.filePath.contains("/home/") && (item.filePath.contains("/Desktop/") || item.filePath.contains("/.lumina/favorites/") );
//Now fill it appropriately
icon->setPixmap( LXDG::findIcon(item.icon,"preferences-system-windows-actions").pixmap(30,30) );
- name->setText( item.name );
+ name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) );
icon->setWhatsThis(item.filePath);
//Now setup the button appropriately
setupButton();
bgstack15