From a8851dd559f8068e42abbac5891c1e83245fe2df Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 3 Mar 2015 09:12:54 -0500 Subject: Make sure that Fluxbox get prompted to reload configs as well after the Lumina session detects screen modifications/changes. --- lumina-desktop/LSession.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 811c60da..aac550c1 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -315,21 +315,24 @@ void LSession::updateDesktops(){ } } //qDebug() << " - Done Starting Desktops"; - //Make sure all the background windows are registered on the system as virtual roots - QTimer::singleShot(200,this, SLOT(registerDesktopWindows())); - if(firstrun){ return; } //Done right here on first run + + if(!firstrun){//Done right here on first run //Now go through and make sure to delete any desktops for detached screens - for(int i=0; iScreen() >= DW->screenCount()){ - qDebug() << " - Close desktop on screen:" << DESKTOPS[i]->Screen(); - DESKTOPS[i]->prepareToClose(); //hide(); - delete DESKTOPS.takeAt(i); - i--; - }else{ - qDebug() << " - Show desktop on screen:" << DESKTOPS[i]->Screen(); - DESKTOPS[i]->show(); + for(int i=0; iScreen() >= DW->screenCount()){ + qDebug() << " - Close desktop on screen:" << DESKTOPS[i]->Screen(); + DESKTOPS[i]->prepareToClose(); //hide(); + delete DESKTOPS.takeAt(i); + i--; + }else{ + qDebug() << " - Show desktop on screen:" << DESKTOPS[i]->Screen(); + DESKTOPS[i]->show(); + } } + WM->updateWM(); //Make sure fluxbox also gets prompted to re-load screen config } + //Make sure all the background windows are registered on the system as virtual roots + QTimer::singleShot(100,this, SLOT(registerDesktopWindows())); //qDebug() << " - Done Checking Desktops"; } -- cgit From 330fb992045599284093d6fa2180b4ca97091ccb Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 10 Mar 2015 17:18:34 -0400 Subject: Ensure that on session-start the audio volume is reset back to the previously-used value before starting the login chimes. --- lumina-desktop/LSession.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index aac550c1..8eef0b95 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -205,6 +205,9 @@ void LSession::launchStartupApps(){ //Now play the login music if(sessionsettings->value("PlayStartupAudio",true).toBool()){ + //Make sure to re-set the system volume to the last-used value at outset + int vol = LOS::audioVolume(); + if(vol>=0){ LOS::setAudioVolume(vol); } LSession::playAudioFile(LOS::LuminaShare()+"Login.ogg"); } if(sessionsettings->value("EnableNumlock",true).toBool()){ -- cgit From 5ecabc4daef6cd3ee739387ecf091f345d65f4f2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 11 Mar 2015 22:38:31 -0400 Subject: Convert the windowImage routine to XCB from XLib, and set the desktop (system tray) to use the new routine. Also setup the desktop to use the new XCB routine for window icons as well. Both are tested on 10.x and appear to work perfectly. --- lumina-desktop/LWinInfo.cpp | 2 +- lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LWinInfo.cpp b/lumina-desktop/LWinInfo.cpp index d46bef92..4ea91c1f 100644 --- a/lumina-desktop/LWinInfo.cpp +++ b/lumina-desktop/LWinInfo.cpp @@ -24,7 +24,7 @@ QString LWinInfo::text(){ QIcon LWinInfo::icon(bool &noicon){ if(window==0){ noicon = true; return QIcon();} noicon = false; - QIcon ico = LX11::WindowIcon(window); + QIcon ico = LSession::handle()->XCB->WindowIcon(window); //Check for a null icon, and supply one if necessary if(ico.isNull()){ ico = LXDG::findIcon( this->Class().toLower(),""); } if(ico.isNull()){ico = LXDG::findIcon("preferences-system-windows",""); noicon=true;} diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 7e0a30f6..23453eed 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -12,6 +12,8 @@ //#include //static xcb_damage_damage_t dmgID; + +#include static int dmgID = 0; TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){ @@ -115,7 +117,8 @@ void TrayIcon::paintEvent(QPaintEvent *event){ //qDebug() << " - Draw tray:" << AID << IID << this->winId(); //qDebug() << " - - " << event->rect().x() << event->rect().y() << event->rect().width() << event->rect().height(); //qDebug() << " - Get image:" << AID; - QPixmap pix = LX11::WindowImage(AID, false); + QPixmap pix = LSession::handle()->XCB->WindowImage(AID, false); + //LX11::WindowImage(AID, false); if(pix.isNull()){ //Try to grab the window directly with Qt qDebug() << " - - Grab window directly"; -- cgit From 950c4ebc4343452dc6f99a9c74d71e4dba9d7eaa Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 11 Mar 2015 23:40:32 -0400 Subject: Just a bit of cleanup in libLumina and adjust the deskopview plugin a bit for non-valid *.desktop files. --- lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 6 +++--- lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index ce20c563..e13a1908 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -54,15 +54,15 @@ void DesktopViewPlugin::updateContents(){ bool ok = false; XDGDesktop desk = LXDG::loadDesktopFile(files[i].absoluteFilePath(), ok); if(ok){ - it->setIcon( LXDG::findIcon(desk.icon,"") ); + it->setIcon( LXDG::findIcon(desk.icon,"unknown") ); it->setText( desk.name ); }else{ //Revert back to a standard file handling - it->setIcon( LXDG::findMimeIcon(files[i].suffix()) ); + it->setIcon( LXDG::findMimeIcon(files[i].fileName()) ); it->setText( files[i].fileName() ); } }else{ - it->setIcon( LXDG::findMimeIcon(files[i].suffix()) ); + it->setIcon( LXDG::findMimeIcon( files[i].fileName() ) ); it->setText( files[i].fileName() ); } list->addItem(it); diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 23453eed..47576478 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -117,7 +117,7 @@ void TrayIcon::paintEvent(QPaintEvent *event){ //qDebug() << " - Draw tray:" << AID << IID << this->winId(); //qDebug() << " - - " << event->rect().x() << event->rect().y() << event->rect().width() << event->rect().height(); //qDebug() << " - Get image:" << AID; - QPixmap pix = LSession::handle()->XCB->WindowImage(AID, false); + QPixmap pix = LSession::handle()->XCB->WindowImage(AID); //LX11::WindowImage(AID, false); if(pix.isNull()){ //Try to grab the window directly with Qt -- cgit From 73d301565ceb3b238b03d1eb55862bd897a1d118 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Mar 2015 00:52:59 -0400 Subject: Add some debugging to the system tray image painting routine. --- lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp | 6 +++++- lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index e13a1908..018f96e8 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -55,7 +55,11 @@ void DesktopViewPlugin::updateContents(){ XDGDesktop desk = LXDG::loadDesktopFile(files[i].absoluteFilePath(), ok); if(ok){ it->setIcon( LXDG::findIcon(desk.icon,"unknown") ); - it->setText( desk.name ); + if(desk.name.isEmpty()){ + it->setText( files[i].fileName() ); + }else{ + it->setText( desk.name ); + } }else{ //Revert back to a standard file handling it->setIcon( LXDG::findMimeIcon(files[i].fileName()) ); diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 47576478..cac49ad7 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -118,7 +118,6 @@ void TrayIcon::paintEvent(QPaintEvent *event){ //qDebug() << " - - " << event->rect().x() << event->rect().y() << event->rect().width() << event->rect().height(); //qDebug() << " - Get image:" << AID; QPixmap pix = LSession::handle()->XCB->WindowImage(AID); - //LX11::WindowImage(AID, false); if(pix.isNull()){ //Try to grab the window directly with Qt qDebug() << " - - Grab window directly"; @@ -129,6 +128,8 @@ void TrayIcon::paintEvent(QPaintEvent *event){ if(!pix.isNull()){ if(this->size() != pix.size()){ QTimer::singleShot(10, this, SLOT(updateIcon())); qDebug() << "-- Icon size mismatch"; } painter.drawPixmap(0,0,this->width(), this->height(), pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) ); + }else{ + qDebug() << " - - No Tray Icon/Image found!" << "ID:" << AID; } //qDebug() << " - Done"; } -- cgit From 3088020d1bdfab0e192cd948212acdade865e75d Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Mar 2015 01:15:37 -0400 Subject: Adjust the QPixmap::grabWindow routine to work better on Qt5 (that function was moved into QScreen) --- lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index cac49ad7..e966f389 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -14,6 +14,8 @@ //static xcb_damage_damage_t dmgID; #include +#include + static int dmgID = 0; TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){ @@ -121,7 +123,11 @@ void TrayIcon::paintEvent(QPaintEvent *event){ if(pix.isNull()){ //Try to grab the window directly with Qt qDebug() << " - - Grab window directly"; - pix = QPixmap::grabWindow(AID); + QList scrnlist = QApplication::screens(); + for(int i=0; igrabWindow(AID); + break; //stop here + } } //qDebug() << " - Pix size:" << pix.size().width() << pix.size().height(); //qDebug() << " - Geom:" << this->geometry().x() << this->geometry().y() << this->geometry().width() << this->geometry().height(); -- cgit From 6f2d86bca68975dc311a4838dbbb30e059d1fc1d Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 12 Mar 2015 08:10:56 -0400 Subject: Update a bunch of icons in the desktop session, and also add a few abilities to the desktopview plugin: 1) Multi-item selection 2) cut/copy files to clipboard 3) delete files 4) increase/decrease icon sizes --- lumina-desktop/LDesktop.cpp | 1 + lumina-desktop/desktop-plugins/LDPlugin.h | 4 + .../desktopview/DesktopViewPlugin.cpp | 98 ++++++++++++++++++++-- .../desktopview/DesktopViewPlugin.h | 24 +++++- lumina-desktop/lumina-desktop.pro | 2 +- .../panel-plugins/userbutton/UserItemWidget.cpp | 2 +- .../panel-plugins/userbutton/UserWidget.cpp | 2 +- 7 files changed, 123 insertions(+), 10 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 9a045e4f..c2ef4a2a 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -287,6 +287,7 @@ void LDesktop::UpdateDesktop(){ if(DEBUG){qDebug() << " -- New Plugin:" << plugins[i];} plug = NewDP::createPlugin(plugins[i], bgDesktop); if(plug != 0){ + connect(plug, SIGNAL(OpenDesktopMenu()), this, SLOT(ShowMenu()) ); //qDebug() << " -- Show Plugin"; PLUGINS << plug; CreateDesktopPluginContainer(plug); diff --git a/lumina-desktop/desktop-plugins/LDPlugin.h b/lumina-desktop/desktop-plugins/LDPlugin.h index 0e1f6847..9660a85c 100644 --- a/lumina-desktop/desktop-plugins/LDPlugin.h +++ b/lumina-desktop/desktop-plugins/LDPlugin.h @@ -68,6 +68,10 @@ public slots: //This needs to be re-implemented in the subclassed plugin //This is where all the visuals are set if using Theme-dependant icons. } + +signals: + void OpenDesktopMenu(); + }; #endif \ No newline at end of file diff --git a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp index 018f96e8..0aa4a3de 100644 --- a/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp +++ b/lumina-desktop/desktop-plugins/desktopview/DesktopViewPlugin.cpp @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include "LSession.h" @@ -17,17 +19,31 @@ DesktopViewPlugin::DesktopViewPlugin(QWidget* parent, QString ID) : LDPlugin(par list->setBatchSize(10); //keep it snappy list->setSpacing(2); list->setSelectionBehavior(QAbstractItemView::SelectItems); - list->setSelectionMode(QAbstractItemView::NoSelection); + list->setSelectionMode(QAbstractItemView::ExtendedSelection); list->setStyleSheet( "QListWidget{ background: transparent; border: none; }" ); - list->setIconSize(QSize(64,64)); + int icosize = settings->value("IconSize",64).toInt(); + list->setIconSize(QSize(icosize,icosize)); list->setUniformItemSizes(true); + list->setContextMenuPolicy(Qt::CustomContextMenu); + + menu = new QMenu(this); + menu->addAction( LXDG::findIcon("run-build-file",""), tr("Open"), this, SLOT(runItems()) ); + menu->addSeparator(); + menu->addAction( LXDG::findIcon("edit-cut",""), tr("Cut"), this, SLOT(cutItems()) ); + menu->addAction( LXDG::findIcon("edit-copy",""), tr("Copy"), this, SLOT(copyItems()) ); + menu->addSeparator(); + menu->addAction( LXDG::findIcon("zoom-in",""), tr("Increase Icons"), this, SLOT(increaseIconSize()) ); + menu->addAction( LXDG::findIcon("zoom-out",""), tr("Decrease Icons"), this, SLOT(decreaseIconSize()) ); + menu->addSeparator(); + menu->addAction( LXDG::findIcon("edit-delete",""), tr("Delete"), this, SLOT(deleteItems()) ); this->layout()->addWidget(list); this->setInitialSize(600,600); watcher = new QFileSystemWatcher(this); watcher->addPath(QDir::homePath()+"/Desktop"); connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(updateContents()) ); - connect(list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(runItem(QListWidgetItem*)) ); + connect(list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(runItems()) ); + connect(list, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showMenu(const QPoint&)) ); QTimer::singleShot(0,this, SLOT(updateContents()) ); } @@ -35,13 +51,83 @@ DesktopViewPlugin::~DesktopViewPlugin(){ } -void DesktopViewPlugin::runItem(QListWidgetItem *item){ - LSession::LaunchApplication("lumina-open \""+item->whatsThis()+"\""); +void DesktopViewPlugin::runItems(){ + QList sel = list->selectedItems(); + for(int i=0; iwhatsThis()+"\""); + } +} + +void DesktopViewPlugin::copyItems(){ + QList sel = list->selectedItems(); + if(sel.isEmpty()){ return; } //nothing selected + QStringList items; + //Format the data string + for(int i=0; iwhatsThis(); + } + //Now save that data to the global clipboard + QMimeData *dat = new QMimeData; + dat->clear(); + dat->setData("x-special/lumina-copied-files", items.join("\n").toLocal8Bit()); + QApplication::clipboard()->clear(); + QApplication::clipboard()->setMimeData(dat); +} + +void DesktopViewPlugin::cutItems(){ + QList sel = list->selectedItems(); + if(sel.isEmpty()){ return; } //nothing selected + QStringList items; + //Format the data string + for(int i=0; iwhatsThis(); + } + //Now save that data to the global clipboard + QMimeData *dat = new QMimeData; + dat->clear(); + dat->setData("x-special/lumina-copied-files", items.join("\n").toLocal8Bit()); + QApplication::clipboard()->clear(); + QApplication::clipboard()->setMimeData(dat); +} + +void DesktopViewPlugin::deleteItems(){ + QList sel = list->selectedItems(); + for(int i=0; iwhatsThis()); + } +} + +void DesktopViewPlugin::showMenu(const QPoint &pos){ + //Make sure there is an item underneath the mouse first + if(list->itemAt(pos)!=0){ + menu->popup(pos); + }else{ + //Pass the context menu request on to the desktop (emit it from the plugin) + emit OpenDesktopMenu(); + } +} + +void DesktopViewPlugin::increaseIconSize(){ + int icosize = settings->value("IconSize",64).toInt(); + icosize+=16; //go in orders of 16 pixels + list->setIconSize(QSize(icosize,icosize)); + settings->setValue("IconSize",icosize); + updateContents(); +} + +void DesktopViewPlugin::decreaseIconSize(){ + int icosize = settings->value("IconSize",64).toInt(); + if(icosize < 20){ return; } //too small to decrease more + icosize-=16; //go in orders of 16 pixels + list->setIconSize(QSize(icosize,icosize)); + settings->setValue("IconSize",icosize); + updateContents(); } void DesktopViewPlugin::updateContents(){ list->clear(); - list->setGridSize(QSize(80,70+this->fontMetrics().height())); + int icosize = settings->value("IconSize",64).toInt(); + list->setGridSize(QSize(icosize+8,icosize+4+this->fontMetrics().height())); QDir dir(QDir::homePath()+"/Desktop"); QFileInfoList files = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Type | QDir::DirsFirst); for(int i=0; i #include #include +#include + #include "../LDPlugin.h" class DesktopViewPlugin : public LDPlugin{ @@ -24,9 +26,16 @@ public: private: QListWidget *list; QFileSystemWatcher *watcher; + QMenu *menu; private slots: - void runItem(QListWidgetItem*); + void runItems(); + void copyItems(); + void cutItems(); + void deleteItems(); + void showMenu(const QPoint&); + void increaseIconSize(); + void decreaseIconSize(); void updateContents(); @@ -37,6 +46,19 @@ public slots: void ThemeChange(){ QTimer::singleShot(0,this, SLOT(updateContents())); } + +/*protected: + void mousePressEvent(QMouseEvent *ev){ + if(ev->button()==Qt::RightButton){ + qDebug() << " - got mouse event"; + //Only show the context menu if an item is under the mouse (don't block the desktop menu) + if(list->itemAt( ev->globalPos()) !=0){ + ev->accept(); + showMenu(ev->globalPos()); + } + } + } + */ }; #endif diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro index feb49f60..dc3db9bd 100644 --- a/lumina-desktop/lumina-desktop.pro +++ b/lumina-desktop/lumina-desktop.pro @@ -1,6 +1,6 @@ QT += core gui network -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets x11extras multimedia dbus +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets x11extras multimedia TARGET = Lumina-DE isEmpty(PREFIX) { diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp index 3b8be74f..53fdb950 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp @@ -101,7 +101,7 @@ void UserItemWidget::setupButton(bool disable){ }else if( !QFile::exists( QDir::homePath()+"/Desktop/"+icon->whatsThis().section("/",-1) ) && !QFile::exists( QDir::homePath()+"/.lumina/favorites/"+icon->whatsThis().section("/",-1) ) ){ //This file does not have a desktop shortcut yet -- allow the user to add it button->setWhatsThis("add"); - button->setIcon( LXDG::findIcon("favorites","") ); + button->setIcon( LXDG::findIcon("bookmark-toolbar","") ); button->setToolTip(tr("Create Shortcut")); connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) ); }else{ diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp index 6ca3ba19..82a06012 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp @@ -16,7 +16,7 @@ UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWid sysapps = LSession::handle()->applicationMenu()->currentAppHash(); //get the raw info //Setup the Icons // - favorites tab - this->setTabIcon(0, rotateIcon(LXDG::findIcon("favorites","")) ); + this->setTabIcon(0, rotateIcon(LXDG::findIcon("folder-favorites","")) ); this->setTabText(0,""); // - apps tab this->setTabIcon(1, rotateIcon(LXDG::findIcon("system-run","")) ); -- cgit From 62cc7a3cdaa759a563d61ff875d3014bafdda28e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 13 Mar 2015 06:42:29 -0400 Subject: Make sure that files visible in the userbutton have the appropriate icons based on the mimetype. --- lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp index 53fdb950..a04c6e43 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp @@ -30,7 +30,7 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, bool isDir, bo } }else{ if(itemPath.endsWith("/")){ itemPath.chop(1); } - icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1).section(".",-1)).pixmap(32,32) ); + icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1)).pixmap(32,32) ); name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) ); } linkPath = QFile::symLinkTarget(itemPath); -- cgit From 477259372f885129593abff171df50c3ce1b3d93 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 13 Mar 2015 06:54:48 -0400 Subject: Add a couple more checks to the notepad plugin so that it does not update/change the current UI for a programmatic save of the info to disk. --- lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lumina-desktop') diff --git a/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp b/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp index 6d4a2b5d..dacaca60 100644 --- a/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp +++ b/lumina-desktop/desktop-plugins/notepad/NotepadPlugin.cpp @@ -200,10 +200,12 @@ void NotePadPlugin::updateContents(){ QString note = cnote->currentData().toString(); updating = true; LUtils::writeFile(note, edit->toPlainText().split("\n"), true); + QApplication::processEvents(); //make sure to process/discard the file changed signal before disabling the flag updating = false; } void NotePadPlugin::notesDirChanged(){ + if(updating){ return; } QString cfile = settings->value("currentFile","").toString(); QStringList notes; QDir dir(QDir::homePath()+"/Notes"); -- cgit From bfb0b8867e706d7c2168bf0d35b39fca3b209d6f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 13 Mar 2015 21:27:11 -0400 Subject: Make sure to clean up any broken sym-links in the favorites directory when the user button is clicked. This needs to be automated/moved once the new favorites system is set in place later. --- lumina-desktop/panel-plugins/userbutton/UserWidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp index 82a06012..1ee0b211 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp @@ -194,6 +194,16 @@ void UserWidget::updateFavItems(){ connect(it, SIGNAL(RemovedShortcut()), this, SLOT(updateFavItems()) ); } static_cast(ui->scroll_fav->widget()->layout())->addStretch(); + + //Clean up any broken sym-links in the favorites directory + items = favdir.entryInfoList(QDir::System | QDir::NoDotAndDotDot, QDir::Name); + for(int i=0; i Date: Sat, 14 Mar 2015 01:27:10 -0400 Subject: Add the ability to set/use custom timezones on the system - defaulting to the system time (whatever that might be). --- lumina-desktop/panel-plugins/clock/LClock.cpp | 4 ++++ lumina-desktop/panel-plugins/clock/LClock.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index e91a3a71..79cae84b 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -35,6 +35,7 @@ LClock::~LClock(){ void LClock::updateTime(){ QDateTime CT = QDateTime::currentDateTime(); + if(useTZ){ CT = CT.toTimeZone(TZ); } //Now update the display QString label; if(deftime){ label = CT.time().toString(Qt::SystemLocaleShortDate) ; } @@ -53,5 +54,8 @@ void LClock::updateFormats(){ datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString(); deftime = timefmt.simplified().isEmpty(); defdate = datefmt.simplified().isEmpty(); + useTZ = LSession::handle()->sessionSettings()->value("CustomTimeZone",false).toBool(); + if(useTZ){ TZ = QTimeZone( LSession::handle()->sessionSettings()->value("TimeZoneByteCode", QByteArray()).toByteArray() ); } + } diff --git a/lumina-desktop/panel-plugins/clock/LClock.h b/lumina-desktop/panel-plugins/clock/LClock.h index 1e4c8294..8156e7d8 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.h +++ b/lumina-desktop/panel-plugins/clock/LClock.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "../LPPlugin.h" @@ -26,7 +27,8 @@ private: QTimer *timer; QLabel *labelWidget; QString timefmt, datefmt; - bool deftime, defdate; + bool deftime, defdate, useTZ; + QTimeZone TZ; private slots: void updateTime(); -- cgit From 49dc5b8575ae610ec0ad9208d3e8f55e46d9c815 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 14 Mar 2015 08:03:35 -0400 Subject: Revert the previous update with regards to the removal of broken "favorite" sym-links. There are many cases where the user would want to keep those links around even when the location it points at is not available at the moment. --- lumina-desktop/panel-plugins/userbutton/UserWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp index 1ee0b211..52d60714 100644 --- a/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp +++ b/lumina-desktop/panel-plugins/userbutton/UserWidget.cpp @@ -196,13 +196,13 @@ void UserWidget::updateFavItems(){ static_cast(ui->scroll_fav->widget()->layout())->addStretch(); //Clean up any broken sym-links in the favorites directory - items = favdir.entryInfoList(QDir::System | QDir::NoDotAndDotDot, QDir::Name); + /*items = favdir.entryInfoList(QDir::System | QDir::NoDotAndDotDot, QDir::Name); for(int i=0; i Date: Sat, 14 Mar 2015 20:49:58 -0400 Subject: Add the ability to increase/decrease the icon size for the applauncher desktop plugin. --- .../applauncher/AppLauncherPlugin.cpp | 42 +++++++++++++++++----- .../applauncher/AppLauncherPlugin.h | 8 +++++ 2 files changed, 41 insertions(+), 9 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index dc0c7596..b3c6afcf 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -7,18 +7,19 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par lay->setContentsMargins(0,0,0,0); button = new QToolButton(this); button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - button->setIconSize(QSize(64,64)); button->setAutoRaise(true); button->setText("..."); //Need to set something here so that initial sizing works properly + lay->addWidget(button, 0, Qt::AlignCenter); connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) ); - this->setInitialSize(64,66+this->fontMetrics().height()); - /*if(this->settings->allKeys().isEmpty()){ - //Brand new plugin: set initial size - this->settings->setValue("location/width",64); - this->settings->setValue("location/height",66+this->fontMetrics().height()); - this->settings->sync(); - }*/ + menu = new QMenu(this); + menu->addAction(LXDG::findIcon("zoom-in",""), tr("Increase Size"), this, SLOT(increaseIconSize())); + menu->addAction(LXDG::findIcon("zoom-out",""), tr("Decrease Size"), this, SLOT(decreaseIconSize())); + int icosize = settings->value("iconsize",64).toInt(); + button->setIconSize(QSize(icosize,icosize)); + this->setInitialSize(icosize,icosize+10+this->fontMetrics().height()); + this->setContextMenuPolicy(Qt::CustomContextMenu); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(openContextMenu()) ); watcher = new QFileSystemWatcher(this); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT( loadButton()) ); QTimer::singleShot(1,this, SLOT(loadButton()) ); @@ -62,4 +63,27 @@ void AppLauncherPlugin::buttonClicked(){ LSession::LaunchApplication("lumina-open \""+path+"\""); } -} \ No newline at end of file +} + +void AppLauncherPlugin::openContextMenu(){ + if(button->underMouse()){ + menu->popup(QCursor::pos()); + }else{ + emit OpenDesktopMenu(); + } +} + +void AppLauncherPlugin::increaseIconSize(){ + int icosize = settings->value("iconsize",64).toInt(); + icosize += 16; + button->setIconSize(QSize(icosize,icosize)); + settings->setValue("iconsize",icosize); +} + +void AppLauncherPlugin::decreaseIconSize(){ + int icosize = settings->value("iconsize",64).toInt(); + if(icosize < 20){ return; } //cannot get smaller + icosize -= 16; + button->setIconSize(QSize(icosize,icosize)); + settings->setValue("iconsize",icosize); +} diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h index bb21b636..2c861e4d 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include "../LDPlugin.h" @@ -30,9 +32,15 @@ public: private: QToolButton *button; QFileSystemWatcher *watcher; + QMenu *menu; private slots: void loadButton(); void buttonClicked(); + void openContextMenu(); + + void increaseIconSize(); + void decreaseIconSize(); + }; #endif -- cgit From e03f0f89495b076804435c100a1458a0a0092a55 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sun, 15 Mar 2015 19:13:29 -0400 Subject: Add support for the older WM_NAME and WM_ICON_NAME standards in addition to the EWMH standards (_NET_WM_NAME, etc..) --- lumina-desktop/LSession.cpp | 5 +++++ lumina-desktop/LWinInfo.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 8eef0b95..6437524b 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -257,6 +257,11 @@ void LSession::checkUserFiles(){ }*/ LUtils::LoadSystemDefaults(); } + if(oldversion <= 83){ + //Convert the old->new favorites framework + + } + //Check for the default applications file for lumina-open dset = QDir::homePath()+"/.lumina/LuminaDE/lumina-open.conf"; if(!QFile::exists(dset)){ diff --git a/lumina-desktop/LWinInfo.cpp b/lumina-desktop/LWinInfo.cpp index 4ea91c1f..b1476c4e 100644 --- a/lumina-desktop/LWinInfo.cpp +++ b/lumina-desktop/LWinInfo.cpp @@ -15,9 +15,11 @@ QString LWinInfo::text(){ if(window==0){ return ""; } QString nm = LSession::handle()->XCB->WindowVisibleIconName(window); - if(nm.isEmpty()){ nm = LSession::handle()->XCB->WindowIconName(window); } - if(nm.isEmpty()){ nm = LSession::handle()->XCB->WindowVisibleName(window); } - if(nm.isEmpty()){ nm = LSession::handle()->XCB->WindowName(window); } + if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowIconName(window); } + if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowVisibleName(window); } + if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->WindowName(window); } + if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->OldWindowIconName(window); } + if(nm.simplified().isEmpty()){ nm = LSession::handle()->XCB->OldWindowName(window); } return nm; } -- cgit From 75202336d3e110c46ed1c7f916c4946deeaf8326 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 16 Mar 2015 02:15:42 -0400 Subject: Add a new panel plugin: applauncher This is a quick shortcut for launching a single application - effectively "pinning" an application to a panel. --- lumina-desktop/lumina-desktop.pro | 2 ++ lumina-desktop/panel-plugins/NewPP.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'lumina-desktop') diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro index dc3db9bd..6c3ee0cc 100644 --- a/lumina-desktop/lumina-desktop.pro +++ b/lumina-desktop/lumina-desktop.pro @@ -50,6 +50,7 @@ SOURCES += main.cpp \ panel-plugins/systemdashboard/SysMenuQuick.cpp \ panel-plugins/showdesktop/LHomeButton.cpp \ panel-plugins/appmenu/LAppMenuPlugin.cpp \ + panel-plugins/applauncher/AppLaunchButton.cpp \ desktop-plugins/applauncher/AppLauncherPlugin.cpp \ desktop-plugins/desktopview/DesktopViewPlugin.cpp \ desktop-plugins/notepad/NotepadPlugin.cpp \ @@ -89,6 +90,7 @@ HEADERS += Globals.h \ panel-plugins/systemdashboard/SysMenuQuick.h \ panel-plugins/showdesktop/LHomeButton.h \ panel-plugins/appmenu/LAppMenuPlugin.h \ + panel-plugins/applauncher/AppLaunchButton.h \ desktop-plugins/SamplePlugin.h \ desktop-plugins/calendar/CalendarPlugin.h \ desktop-plugins/applauncher/AppLauncherPlugin.h \ diff --git a/lumina-desktop/panel-plugins/NewPP.h b/lumina-desktop/panel-plugins/NewPP.h index 6c5c369c..3a593629 100644 --- a/lumina-desktop/panel-plugins/NewPP.h +++ b/lumina-desktop/panel-plugins/NewPP.h @@ -23,6 +23,7 @@ #include "systemdashboard/LSysDashboard.h" #include "showdesktop/LHomeButton.h" #include "appmenu/LAppMenuPlugin.h" +#include "applauncher/AppLaunchButton.h" #include "systemtray/LSysTray.h" //must be last due to X11 compile issues class NewPP{ @@ -52,6 +53,8 @@ public: plug = new LSysDashboard(parent, plugin, horizontal); }else if(plugin.startsWith("appmenu---")){ plug = new LAppMenuPlugin(parent, plugin, horizontal); + }else if(plugin.section("---",0,0).section("::",0,0)=="applauncher"){ + plug = new AppLaunchButtonPlugin(parent, plugin, horizontal); }else{ qWarning() << "Invalid Panel Plugin:"< Date: Tue, 17 Mar 2015 12:13:50 -0400 Subject: Oops, forgot to add the new applauncher plugin files to GIT. --- .../panel-plugins/applauncher/AppLaunchButton.cpp | 73 ++++++++++++++++++++++ .../panel-plugins/applauncher/AppLaunchButton.h | 63 +++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp create mode 100644 lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp new file mode 100644 index 00000000..e4447ce0 --- /dev/null +++ b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -0,0 +1,73 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "AppLaunchButton.h" +#include "../../LSession.h" + +#include + +AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ + button = new QToolButton(this); + button->setAutoRaise(true); + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + appfile = id.section("---",0,0).section("::",1,1); + if(!QFile::exists(appfile)){ appfile.clear(); } + connect(button, SIGNAL(clicked()), this, SLOT(AppClicked())); + this->layout()->setContentsMargins(0,0,0,0); + this->layout()->addWidget(button); + + QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes +} + +AppLaunchButtonPlugin::~AppLaunchButtonPlugin(){ + +} + +void AppLaunchButtonPlugin::updateButtonVisuals(){ + QIcon icon; + QString tooltip = tr("Click to assign an application"); + if(appfile.endsWith(".desktop")){ + bool ok = false; + XDGDesktop desk = LXDG::loadDesktopFile(appfile,ok); + if(ok){ + icon = LXDG::findIcon(desk.icon, "unknown"); + tooltip = QString(tr("Launch %1")).arg(desk.name); + }else{ + icon = LXDG::findIcon("task-attention",""); + appfile.clear(); + } + }else if(QFile::exists(appfile)){ + icon = LXDG::findMimeIcon(appfile.section("/",-1)); + tooltip = QString(tr("Open %1")).arg(appfile.section("/",-1)); + }else{ + icon = LXDG::findIcon("task-attention", ""); + } + button->setIcon( icon ); + button->setToolTip(tooltip); +} + +// ======================== +// PRIVATE FUNCTIONS +// ======================== +void AppLaunchButtonPlugin::AppClicked(){ + if(appfile.isEmpty()){ + //No App File selected + QList apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All"); + QStringList names; + for(int i=0; i" -> "applauncher::fixed---" ? + QTimer::singleShot(0,this, SLOT(updateButtonVisuals())); + }else{ + LSession::LaunchApplication("lumina-open \""+appfile+"\""); + } +} + diff --git a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h new file mode 100644 index 00000000..3aa3c7ad --- /dev/null +++ b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h @@ -0,0 +1,63 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This panel plugin is a simple button to launch a single application +//=========================================== +#ifndef _LUMINA_DESKTOP_LAUNCH_APP_PANEL_PLUGIN_H +#define _LUMINA_DESKTOP_LAUNCH_APP_PANEL_PLUGIN_H + +// Qt includes +#include +#include +#include + + +// Lumina-desktop includes +#include "../LPPlugin.h" //main plugin widget + +// libLumina includes +#include "LuminaXDG.h" + +// PANEL PLUGIN BUTTON +class AppLaunchButtonPlugin : public LPPlugin{ + Q_OBJECT + +public: + AppLaunchButtonPlugin(QWidget *parent = 0, QString id = "applauncher", bool horizontal=true); + ~AppLaunchButtonPlugin(); + +private: + QToolButton *button; + QString appfile; + + void updateButtonVisuals(); + +private slots: + void AppClicked(); + +public slots: + void OrientationChange(){ + if(this->layout()->direction()==QBoxLayout::LeftToRight){ + this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + button->setIconSize( QSize(this->height(), this->height()) ); + }else{ + this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); + button->setIconSize( QSize(this->width(), this->width()) ); + } + this->layout()->update(); + updateButtonVisuals(); + } + + void LocaleChange(){ + updateButtonVisuals(); + } + + void ThemeChange(){ + updateButtonVisuals(); + } +}; + +#endif \ No newline at end of file -- cgit From 7981690582d551e015847d0d31e6f916c9ffbe4c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 19 Mar 2015 10:58:26 -0400 Subject: Update some panel plugins so that they minimize empty space when only an icon is visible. --- lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp | 2 +- lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp index e4447ce0..5bd7fa96 100644 --- a/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp +++ b/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp @@ -12,7 +12,7 @@ AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ button = new QToolButton(this); button->setAutoRaise(true); - button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setToolButtonStyle(Qt::ToolButtonIconOnly); appfile = id.section("---",0,0).section("::",1,1); if(!QFile::exists(appfile)){ appfile.clear(); } connect(button, SIGNAL(clicked()), this, SLOT(AppClicked())); diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index 7c24dc3d..20607c60 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -121,13 +121,14 @@ void LTaskButton::UpdateButton(){ //single window this->setPopupMode(QToolButton::DelayedPopup); this->setMenu(actMenu); - if(showText){ this->setText( this->fontMetrics().elidedText(WINLIST[0].text(), Qt::ElideRight,80) ); } - else if(noicon){ this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) ); } - else{ this->setText(""); } + if(showText){ this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setText( this->fontMetrics().elidedText(WINLIST[0].text(), Qt::ElideRight,80) ); } + else if(noicon){ this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) ); } + else{ this->setToolButtonStyle(Qt::ToolButtonIconOnly); this->setText(""); } }else if(WINLIST.length() > 1){ //multiple windows this->setPopupMode(QToolButton::InstantPopup); this->setMenu(winMenu); + this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); if(noicon || showText){ this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) +" ("+QString::number(WINLIST.length())+")" ); } else{ this->setText("("+QString::number(WINLIST.length())+")"); } } -- cgit