aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2014-12-31 10:39:18 -0500
committerKen Moore <ken@pcbsd.org>2014-12-31 10:39:18 -0500
commitf8a5d88985688cd8bcfd2e2145a58f30cef8ec8f (patch)
treea1a58abf3e2b79cf709375f782c96a93a93ce952 /lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp
parentBe a little bit more careful about the handling of the "Exec=" field codes in... (diff)
downloadlumina-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/LTaskManagerPlugin.cpp')
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp
index 3f223a63..b551a795 100644
--- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp
+++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp
@@ -12,6 +12,8 @@ LTaskManagerPlugin::LTaskManagerPlugin(QWidget *parent, QString id, bool horizon
timer->setSingleShot(true);
timer->setInterval(10); // 1/100 second
connect(timer, SIGNAL(timeout()), this, SLOT(UpdateButtons()) );
+ usegroups = true; //backwards-compatible default value
+ if(id.contains("-nogroups")){ usegroups = false; }
connect(LSession::instance(), SIGNAL(WindowListEvent()), this, SLOT(checkWindows()) );
this->layout()->setContentsMargins(0,0,0,0);
QTimer::singleShot(0,this, SLOT(UpdateButtons()) ); //perform an initial sync
@@ -80,7 +82,8 @@ void LTaskManagerPlugin::UpdateButtons(){
bool found = false;
for(int b=0; b<BUTTONS.length(); b++){
if(updating > ctime){ return; } //another thread kicked off already - stop this one
- if(BUTTONS[b]->classname()== ctxt){
+ if(BUTTONS[b]->classname()== ctxt && usegroups){
+ //This adds a window to an existing group
found = true;
qDebug() << "Add Window to Button:" << b;
BUTTONS[b]->addWindow(winlist[i]);
@@ -91,7 +94,7 @@ void LTaskManagerPlugin::UpdateButtons(){
if(updating > ctime){ return; } //another thread kicked off already - stop this one
//No group, create a new button
qDebug() << "New Button";
- LTaskButton *but = new LTaskButton(this);
+ LTaskButton *but = new LTaskButton(this, usegroups);
but->addWindow( LWinInfo(winlist[i]) );
if(this->layout()->direction()==QBoxLayout::LeftToRight){
but->setIconSize(QSize(this->height(), this->height()));
bgstack15