aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
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/userbutton/UserItemWidget.h
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/userbutton/UserItemWidget.h')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.h17
1 files changed, 14 insertions, 3 deletions
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