diff options
author | Ken Moore <ken@pcbsd.org> | 2014-12-31 10:39:18 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-12-31 10:39:18 -0500 |
commit | f8a5d88985688cd8bcfd2e2145a58f30cef8ec8f (patch) | |
tree | a1a58abf3e2b79cf709375f782c96a93a93ce952 /lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | |
parent | Be a little bit more careful about the handling of the "Exec=" field codes in... (diff) | |
download | lumina-f8a5d88985688cd8bcfd2e2145a58f30cef8ec8f.tar.gz lumina-f8a5d88985688cd8bcfd2e2145a58f30cef8ec8f.tar.bz2 lumina-f8a5d88985688cd8bcfd2e2145a58f30cef8ec8f.zip |
Make the taskmanager plugin capable of two modes:
1) The normal mode/behaviour is to group windows by application (backwards compatible)
2) The "-nogroups" mode ensures that every window gets it's own button (uses a lot more space on the panel since it need to put part of the window title on each button too)
This two modes are treated as distinct plugins via lumina-config for simplification purposes.
Diffstat (limited to 'lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp')
-rw-r--r-- | lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index 9dfc0979..3b88b537 100644 --- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -7,11 +7,11 @@ #include "LTaskButton.h" #include "LSession.h" -LTaskButton::LTaskButton(QWidget *parent) : LTBWidget(parent){ +LTaskButton::LTaskButton(QWidget *parent, bool smallDisplay) : LTBWidget(parent){ actMenu = new QMenu(this); winMenu = new QMenu(this); UpdateMenus(); - + showText = !smallDisplay; this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); this->setAutoRaise(false); //make sure these always look like buttons this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -108,13 +108,14 @@ void LTaskButton::UpdateButton(){ //single window this->setPopupMode(QToolButton::DelayedPopup); this->setMenu(actMenu); - if(noicon){ this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) ); } + 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(""); } }else if(WINLIST.length() > 1){ //multiple windows this->setPopupMode(QToolButton::InstantPopup); this->setMenu(winMenu); - if(noicon){ this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) +" ("+QString::number(WINLIST.length())+")" ); } + if(noicon || showText){ this->setText( this->fontMetrics().elidedText(cname, Qt::ElideRight ,80) +" ("+QString::number(WINLIST.length())+")" ); } else{ this->setText("("+QString::number(WINLIST.length())+")"); } } this->setState(showstate); //Make sure this is after the button setup so that it properly sets the margins/etc @@ -140,7 +141,8 @@ void LTaskButton::buttonClicked(){ void LTaskButton::closeWindow(){ if(winMenu->isVisible()){ winMenu->hide(); } LWinInfo win = currentWindow(); - LX11::CloseWindow(win.windowID()); + LSession::handle()->XCB->CloseWindow(win.windowID()); + //LX11::CloseWindow(win.windowID()); cWin = LWinInfo(); //clear the current } |