diff options
author | Ken Moore <moorekou@gmail.com> | 2015-11-23 13:26:49 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-11-23 13:26:49 -0500 |
commit | 42b9bf131bc17f9fb0e7e9ead0c6f992eee11a2b (patch) | |
tree | e2932a8b22a5353e698d50823e8e842ff5e2fed3 /lumina-desktop/panel-plugins/systemstart | |
parent | Fix up the window minimization routines and the window margins for the embedd... (diff) | |
download | lumina-42b9bf131bc17f9fb0e7e9ead0c6f992eee11a2b.tar.gz lumina-42b9bf131bc17f9fb0e7e9ead0c6f992eee11a2b.tar.bz2 lumina-42b9bf131bc17f9fb0e7e9ead0c6f992eee11a2b.zip |
A few fixes for the desktop:
1) Clean up the characters which are unsupported by the notepad for filenames (quotes of all kinds, semicolons, slashes)
2) Start Menu: allow clicks on the item text to trigger the launch, add the generic "comment" text underneath the name of the application (if available) in italics and indented.
3) Remove an extra processEvents call during session startup.
Diffstat (limited to 'lumina-desktop/panel-plugins/systemstart')
-rw-r--r-- | lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp b/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp index 8754e534..8c0fae09 100644 --- a/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp +++ b/lumina-desktop/panel-plugins/systemstart/ItemWidget.cpp @@ -21,8 +21,9 @@ ItemWidget::ItemWidget(QWidget *parent, QString itemPath, QString type, bool gob if(ok && LXDG::checkValidity(item) ){ icon->setPixmap( LXDG::findIcon(item.icon, "preferences-system-windows-actions").pixmap(32,32) ); iconPath = item.icon; - name->setText( item.name); text = item.name; + if(!item.comment.isEmpty()){ text.append("<br><i> -- "+item.comment+"</i>"); } + name->setText(text); setupActions(item); }else{ gooditem = false; @@ -102,9 +103,10 @@ ItemWidget::ItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent){ } //Now fill it appropriately icon->setPixmap( LXDG::findIcon(item.icon,"preferences-system-windows-actions").pixmap(64,64) ); - name->setText( item.name); - text = item.name; - this->setWhatsThis(name->text()); + text = item.name; + if(!item.comment.isEmpty()){ text.append("<br><i> -- "+item.comment+"</i>"); } + name->setText(text); + this->setWhatsThis(item.name); icon->setWhatsThis(item.filePath); iconPath = item.icon; //Now setup the buttons appropriately @@ -132,6 +134,8 @@ void ItemWidget::createWidget(){ icon = new QLabel(this); name = new QLabel(this); name->setWordWrap(true); + name->setTextFormat(Qt::RichText); + name->setTextInteractionFlags(Qt::NoTextInteraction); //Add them to the layout this->setLayout(new QHBoxLayout()); this->layout()->setContentsMargins(1,1,1,1); @@ -186,7 +190,9 @@ void ItemWidget::updateItems(){ int H = 2.3*name->fontMetrics().height(); //make sure the height is large enough for two lines icon->setFixedSize(QSize(H-4, H-4)); actButton->setFixedSize( QSize( (H-4)/2, H-4) ); - name->setText( name->fontMetrics().elidedText(text, Qt::ElideRight, name->width()) ); + QStringList newname = text.split("<br>"); + for(int i=0; i<newname.length(); i++){ newname[i] = name->fontMetrics().elidedText(newname[i], Qt::ElideRight, name->width()); } + name->setText( newname.join("<br>") ); //Now reload the icon if necessary if(icon->pixmap()->size().height() < (H-4) ){ if(iconPath.isEmpty()){ |