aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-24 12:44:06 -0400
committerKen Moore <moorekou@gmail.com>2015-07-24 12:44:06 -0400
commitdef21620add40cbfb992ed937841122bdf88587c (patch)
treea0f232ec30172ab981ebadf7d9c4e04df805064e /lumina-desktop/panel-plugins
parentFix up the active re-loading of icons in the desktop interface when the icon ... (diff)
downloadlumina-def21620add40cbfb992ed937841122bdf88587c.tar.gz
lumina-def21620add40cbfb992ed937841122bdf88587c.tar.bz2
lumina-def21620add40cbfb992ed937841122bdf88587c.zip
Finish cleaning up the submenu open/close checks for the userbutton. Now the "Action" submenu can be closed without launching the base application.
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp9
-rw-r--r--lumina-desktop/panel-plugins/userbutton/UserItemWidget.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
index f0d87611..baf8f6de 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp
@@ -66,10 +66,6 @@ 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;
@@ -98,6 +94,10 @@ UserItemWidget::~UserItemWidget(){
void UserItemWidget::createWidget(){
//Initialize the widgets
+ menuopen = false;
+ menureset = new QTimer(this);
+ menureset->setSingleShot(true);
+ menureset->setInterval(1000); //1 second
this->setContentsMargins(0,0,0,0);
button = new QToolButton(this);
button->setIconSize( QSize(14,14) );
@@ -165,6 +165,7 @@ void UserItemWidget::setupActions(XDGDesktop app){
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()) );
+ connect(menureset, SIGNAL(timeout()), this, SLOT(resetmenuflag()) );
}
void UserItemWidget::buttonClicked(){
diff --git a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
index 6d73401d..3a3e1616 100644
--- a/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
+++ b/lumina-desktop/panel-plugins/userbutton/UserItemWidget.h
@@ -48,8 +48,8 @@ private slots:
void actionClicked(QAction*);
//Functions to fix the submenu open/close issues
void actionMenuOpen(){
- menuopen = true;
- if(menureset->isActive()){ menureset->stop(); }
+ if(menureset->isActive()){ menureset->stop(); }
+ menuopen = true;
}
void resetmenuflag(){ menuopen = false; } //tied to the "menureset" timer
void actionMenuClosed(){ menureset->start(); }
bgstack15