aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lumina-config/LPlugins.cpp9
-rw-r--r--lumina-desktop/panel-plugins/NewPP.h3
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp12
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskButton.h4
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.cpp7
-rw-r--r--lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h1
6 files changed, 25 insertions, 11 deletions
diff --git a/lumina-config/LPlugins.cpp b/lumina-config/LPlugins.cpp
index a257a690..731908b5 100644
--- a/lumina-config/LPlugins.cpp
+++ b/lumina-config/LPlugins.cpp
@@ -104,10 +104,17 @@ void LPlugins::LoadPanelPlugins(){
//Task Manager
info = LPI(); //clear it
info.name = QObject::tr("Task Manager");
- info.description = QObject::tr("View and control any running application windows");
+ info.description = QObject::tr("View and control any running application windows (every application has a button)");
info.ID = "taskmanager";
info.icon = "preferences-system-windows";
PANEL.insert(info.ID, info);
+ //Task Manager
+ info = LPI(); //clear it
+ info.name = QObject::tr("Task Manager (No Groups)");
+ info.description = QObject::tr("View and control any running application windows (every window has a button)");
+ info.ID = "taskmanager-nogroups";
+ info.icon = "preferences-system-windows";
+ PANEL.insert(info.ID, info);
//System Tray
info = LPI(); //clear it
info.name = QObject::tr("System Tray");
diff --git a/lumina-desktop/panel-plugins/NewPP.h b/lumina-desktop/panel-plugins/NewPP.h
index c378f07e..f71ad45b 100644
--- a/lumina-desktop/panel-plugins/NewPP.h
+++ b/lumina-desktop/panel-plugins/NewPP.h
@@ -33,7 +33,8 @@ public:
plug = new LDeskBarPlugin(parent, plugin, horizontal);
}else if(plugin.startsWith("spacer---")){
plug = new LSpacerPlugin(parent, plugin, horizontal);
- }else if(plugin.startsWith("taskmanager---")){
+ }else if(plugin.startsWith("taskmanager")){
+ //This one can be "taskmanager[-nogroups]---"
plug = new LTaskManagerPlugin(parent, plugin, horizontal);
}else if(plugin.startsWith("systemtray---")){
plug = new LSysTray(parent, plugin, horizontal);
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
}
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
index 0b2ffb05..1fd81e0b 100644
--- a/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
+++ b/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
@@ -27,7 +27,7 @@
class LTaskButton : public LTBWidget{
Q_OBJECT
public:
- LTaskButton(QWidget *parent=0);
+ LTaskButton(QWidget *parent=0, bool smallDisplay = true);
~LTaskButton();
//Window Information
@@ -45,7 +45,7 @@ private:
QMenu *winMenu; // window menu (if more than 1)
LWinInfo cWin;
QString cname; //class name for the entire button
- bool noicon;
+ bool noicon, showText;
LWinInfo currentWindow(); //For getting the currently-active window
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()));
diff --git a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h
index b8867074..6aebcb17 100644
--- a/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h
+++ b/lumina-desktop/panel-plugins/taskmanager/LTaskManagerPlugin.h
@@ -34,6 +34,7 @@ private:
QList<LTaskButton*> BUTTONS; //to keep track of the current buttons
QTimer *timer;
QDateTime updating; //quick flag for if it is currently working
+ bool usegroups;
private slots:
void UpdateButtons();
bgstack15