aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-24 12:38:28 -0400
committerKen Moore <moorekou@gmail.com>2015-07-24 12:38:28 -0400
commit42b0bd6f25785c3823fdac7651e939bb921db627 (patch)
treeb54efa8fa60b6abd3c3214f8395b8878825a4ce2 /lumina-desktop/panel-plugins
parentFinish up the XDG "Actions" specification for *.desktop files, and integrate ... (diff)
downloadlumina-42b0bd6f25785c3823fdac7651e939bb921db627.tar.gz
lumina-42b0bd6f25785c3823fdac7651e939bb921db627.tar.bz2
lumina-42b0bd6f25785c3823fdac7651e939bb921db627.zip
Fix up the active re-loading of icons in the desktop interface when the icon theme changes.
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r--lumina-desktop/panel-plugins/LPPlugin.h1
-rw-r--r--lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h7
-rw-r--r--lumina-desktop/panel-plugins/userbutton/LUserButton.h1
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp8
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.h17
5 files changed, 29 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/LPPlugin.h b/lumina-desktop/panel-plugins/LPPlugin.h
index 8d1c0024..52df3298 100644
--- a/lumina-desktop/panel-plugins/LPPlugin.h
+++ b/lumina-desktop/panel-plugins/LPPlugin.h
@@ -36,6 +36,7 @@ public:
LY->setSpacing(1);
this->setLayout(LY);
connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChange()) );
+ connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(ThemeChange()) );
}
~LPPlugin(){
diff --git a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
index 7910f452..782fc4e6 100644
--- a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
+++ b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
@@ -54,7 +54,12 @@ public slots:
updateIcon(true);
sysmenu->UpdateMenu();
}
-
+
+ void ThemeChange(){
+ updateIcon(true);
+ sysmenu->UpdateMenu();
+ }
+
void OrientationChange(){
if(this->layout()->direction()==QBoxLayout::LeftToRight){
this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.h b/lumina-desktop/panel-plugins/userbutton/LUserButton.h
index 31bafa78..c5612e15 100644
--- a/lumina-desktop/panel-plugins/userbutton/LUserButton.h
+++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.h
@@ -67,6 +67,7 @@ public slots:
void ThemeChange(){
updateButtonVisuals();
+ usermenu->UpdateAll();
}
};
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index 76a0b4cf..f0d87611 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -66,6 +66,10 @@ UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, QString type,
UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent){
createWidget();
+ menuopen = false;
+ menureset = new QTimer(this);
+ menureset->setSingleShot(true);
+ menureset->setInterval(1000); //1 second
isDirectory = false;
if(LUtils::isFavorite(item.filePath)){
linkPath = item.filePath;
@@ -108,8 +112,8 @@ void UserItemWidget::createWidget(){
//Add them to the layout
this->setLayout(new QHBoxLayout());
this->layout()->setContentsMargins(1,1,1,1);
- this->layout()->addWidget(actButton);
this->layout()->addWidget(icon);
+ this->layout()->addWidget(actButton);
this->layout()->addWidget(name);
this->layout()->addWidget(button);
//Set a custom object name so this can be tied into the Lumina Theme stylesheets
@@ -159,6 +163,8 @@ void UserItemWidget::setupActions(XDGDesktop app){
actButton->menu()->addAction(act);
}
connect(actButton->menu(), SIGNAL(triggered(QAction*)), this, SLOT(actionClicked(QAction*)) );
+ connect(actButton->menu(), SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) );
+ connect(actButton->menu(), SIGNAL(aboutToHide()), this, SLOT(actionMenuClosed()) );
}
void UserItemWidget::buttonClicked(){
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
index b3c5aea7..6d73401d 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
@@ -19,7 +19,8 @@
#include <QFile>
#include <QMouseEvent>
#include <QAction>
-
+#include <QMenu>
+#include <QTimer>
#include <LuminaXDG.h>
@@ -33,8 +34,9 @@ public:
private:
QToolButton *button, *actButton;
QLabel *icon, *name;
- bool isDirectory, isShortcut;
+ bool isDirectory, isShortcut, menuopen;
QString linkPath;
+ QTimer *menureset;
void createWidget();
void setupButton(bool disable = false);
@@ -44,10 +46,19 @@ private slots:
void buttonClicked();
void ItemClicked();
void actionClicked(QAction*);
+ //Functions to fix the submenu open/close issues
+ void actionMenuOpen(){
+ menuopen = true;
+ if(menureset->isActive()){ menureset->stop(); }
+ }
+ void resetmenuflag(){ menuopen = false; } //tied to the "menureset" timer
+ void actionMenuClosed(){ menureset->start(); }
+
protected:
void mouseReleaseEvent(QMouseEvent *event){
- if(event->button() != Qt::NoButton){ ItemClicked(); }
+ if(menuopen){ resetmenuflag(); } //skip this event if a submenu was open
+ else if(event->button() != Qt::NoButton){ ItemClicked(); }
}
signals:
bgstack15