diff options
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/AppMenu.cpp | 1 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 7 | ||||
-rw-r--r-- | lumina-desktop/LSession.h | 2 | ||||
-rw-r--r-- | lumina-desktop/SettingsMenu.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/SystemWindow.cpp | 1 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/LDPlugin.cpp | 1 | ||||
-rw-r--r-- | lumina-desktop/main.cpp | 1 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/LPPlugin.h | 1 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h | 7 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/LUserButton.h | 1 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserItemWidget.cpp | 8 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/UserItemWidget.h | 17 |
12 files changed, 43 insertions, 6 deletions
diff --git a/lumina-desktop/AppMenu.cpp b/lumina-desktop/AppMenu.cpp index dec9422e..9f1282ff 100644 --- a/lumina-desktop/AppMenu.cpp +++ b/lumina-desktop/AppMenu.cpp @@ -17,6 +17,7 @@ AppMenu::AppMenu(QWidget* parent) : QMenu(parent){ //QTimer::singleShot(200, this, SLOT(start()) ); //Now start filling the menu start(); //do the initial run during session init so things are responsive immediately. connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(watcherUpdate()) ); + connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(watcherUpdate()) ); } AppMenu::~AppMenu(){ diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index b2219072..6edfe5a4 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -309,6 +309,13 @@ void LSession::StartReboot(){ QCoreApplication::exit(0); } +void LSession::reloadIconTheme(){ + //Wait a moment for things to settle before sending out the signal to the interfaces + QApplication::processEvents(); + QApplication::processEvents(); + emit IconThemeChanged(); +} + void LSession::watcherChange(QString changed){ if(DEBUG){ qDebug() << "Session Watcher Change:" << changed; } if(changed.endsWith("fluxbox-init") || changed.endsWith("fluxbox-keys")){ refreshWindowManager(); } diff --git a/lumina-desktop/LSession.h b/lumina-desktop/LSession.h index 6a73b04a..3a1dabbc 100644 --- a/lumina-desktop/LSession.h +++ b/lumina-desktop/LSession.h @@ -127,6 +127,8 @@ public slots: void StartShutdown(); void StartReboot(); + void reloadIconTheme(); + private slots: void watcherChange(QString); void checkWindowGeoms(); diff --git a/lumina-desktop/SettingsMenu.cpp b/lumina-desktop/SettingsMenu.cpp index f9a2fa13..4d0749d4 100644 --- a/lumina-desktop/SettingsMenu.cpp +++ b/lumina-desktop/SettingsMenu.cpp @@ -12,7 +12,7 @@ SettingsMenu::SettingsMenu() : QMenu(){ connect(this, SIGNAL(triggered(QAction*)), this, SLOT(runApp(QAction*)) ); connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(UpdateMenu()) ); - + connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(UpdateMenu()) ); QTimer::singleShot(100, this, SLOT(UpdateMenu()) ); } diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp index 54e240c1..74538404 100644 --- a/lumina-desktop/SystemWindow.cpp +++ b/lumina-desktop/SystemWindow.cpp @@ -31,6 +31,7 @@ SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){ updateWindow(); ui->tool_suspend->setVisible(LOS::systemCanSuspend()); //does not change with time - just do a single check connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(updateWindow()) ); + connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(updateWindow()) ); } SystemWindow::~SystemWindow(){ diff --git a/lumina-desktop/desktop-plugins/LDPlugin.cpp b/lumina-desktop/desktop-plugins/LDPlugin.cpp index e60014d4..26ed7eff 100644 --- a/lumina-desktop/desktop-plugins/LDPlugin.cpp +++ b/lumina-desktop/desktop-plugins/LDPlugin.cpp @@ -16,6 +16,7 @@ LDPlugin::LDPlugin(QWidget *parent, QString id) : QFrame(parent){ //Use plugin-specific values for stylesheet control (applauncher, desktopview, etc...) this->setObjectName(id.section("---",0,0).section("::",0,0)); connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChange()) ); + connect(QApplication::instance(), SIGNAL(IconThemeChanged()), this, SLOT(ThemeChange()) ); } void LDPlugin::setInitialSize(int width, int height){ diff --git a/lumina-desktop/main.cpp b/lumina-desktop/main.cpp index 4bcde4f8..4a2903e6 100644 --- a/lumina-desktop/main.cpp +++ b/lumina-desktop/main.cpp @@ -84,6 +84,7 @@ int main(int argc, char ** argv) qInstallMessageHandler(MessageOutput); if(DEBUG){ qDebug() << "Theme Init:" << timer->elapsed(); } LuminaThemeEngine theme(&a); + QObject::connect(&theme, SIGNAL(updateIcons()), &a, SLOT(reloadIconTheme()) ); //if(DEBUG){ qDebug() << "Load Locale:" << timer->elapsed(); } //LUtils::LoadTranslation(&a, "lumina-desktop"); if(DEBUG){ qDebug() << "Session Setup:" << timer->elapsed(); } 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: |