aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-18 10:46:52 -0400
committerKen Moore <ken@ixsystems.com>2017-09-18 10:46:52 -0400
commita9671a98baf769f750f6fc3a85fe184968fbfda8 (patch)
tree148ea2092d9c9a59277195585d0d1d15f9e5002b /src-qt5/core/lumina-desktop
parentMinor change: (diff)
downloadlumina-a9671a98baf769f750f6fc3a85fe184968fbfda8.tar.gz
lumina-a9671a98baf769f750f6fc3a85fe184968fbfda8.tar.bz2
lumina-a9671a98baf769f750f6fc3a85fe184968fbfda8.zip
Fix up the icon sync on theme change, and change the icon for lumina-mediaplayer to one that exists in more themes
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h11
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h16
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h15
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp7
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h13
6 files changed, 46 insertions, 18 deletions
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
index 34a75ce8..c8e3a475 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.h
@@ -30,7 +30,7 @@ public:
~AppLauncherPlugin(){}
void Cleanup(); //special function for final cleanup
-
+
private:
QToolButton *button;
QFileSystemWatcher *watcher;
@@ -45,7 +45,7 @@ private slots:
void iconLoaded(QString);
//void openContextMenu();
-
+
//void increaseIconSize();
//void decreaseIconSize();
//void deleteFile();
@@ -63,11 +63,16 @@ public slots:
void LocaleChange(){
loadButton(); //force reload
}
-
+
protected:
void resizeEvent(QResizeEvent *ev){
LDPlugin::resizeEvent(ev);
QTimer::singleShot(100, this, SLOT(loadButton()) );
}
+ void changeEvent(QEvent *ev){
+ LDPlugin::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp == QEvent::StyleChange || tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){ loadButton(); }
+ }
};
#endif
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
index 3aa3c7ad..f146df66 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.h
@@ -24,11 +24,11 @@
// PANEL PLUGIN BUTTON
class AppLaunchButtonPlugin : public LPPlugin{
Q_OBJECT
-
+
public:
AppLaunchButtonPlugin(QWidget *parent = 0, QString id = "applauncher", bool horizontal=true);
~AppLaunchButtonPlugin();
-
+
private:
QToolButton *button;
QString appfile;
@@ -50,14 +50,18 @@ public slots:
this->layout()->update();
updateButtonVisuals();
}
-
- void LocaleChange(){
+ void LocaleChange(){
updateButtonVisuals();
}
-
void ThemeChange(){
updateButtonVisuals();
}
+protected:
+ void changeEvent(QEvent *ev){
+ LPPlugin::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp == QEvent::StyleChange || tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){ updateButtonVisuals(); }
+ }
};
-#endif \ No newline at end of file
+#endif
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
index be5b8488..cae73d13 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
@@ -77,7 +77,7 @@ void LBattery::updateBattery(bool force){
break;
}
if(icon<iconOld && icon==0){
- //Play some audio warning chime when
+ //Play some audio warning chime when
QString sfile = LSession::handle()->sessionSettings()->value("audiofiles/batterylow", LOS::LuminaShare()+"low-battery.ogg").toString();
LSession::handle()->playAudioFile(sfile);
}
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
index 29562d5d..d14cfc53 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
@@ -25,12 +25,12 @@ class LBattery : public LPPlugin{
public:
LBattery(QWidget *parent = 0, QString id = "battery", bool horizontal=true);
~LBattery();
-
+
private:
QTimer *timer;
QLabel *label;
int iconOld;
-
+
private slots:
void updateBattery(bool force = false);
QString getRemainingTime();
@@ -39,7 +39,7 @@ public slots:
void LocaleChange(){
updateBattery(true);
}
-
+
void OrientationChange(){
if(this->layout()->direction()==QBoxLayout::LeftToRight){
label->setFixedSize( QSize(this->height(), this->height()) );
@@ -48,6 +48,15 @@ public slots:
}
updateBattery(true); //force icon refresh
}
+protected:
+ void changeEvent(QEvent *ev){
+ LPPlugin::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){
+ updateBattery(true);
+ }
+ }
+
};
#endif
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
index ab4e786f..8f867261 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp
@@ -30,7 +30,7 @@ LTaskButton::LTaskButton(QWidget *parent, bool smallDisplay) : LTBWidget(parent)
}
LTaskButton::~LTaskButton(){
-
+
}
//===========
@@ -81,11 +81,12 @@ LWinInfo LTaskButton::currentWindow(){
//=============
// PUBLIC SLOTS
//=============
+
void LTaskButton::UpdateButton(){
if(winMenu->isVisible()){ return; } //skip this if the window menu is currently visible for now
bool statusOnly = (WINLIST.length() == LWINLIST.length());
LWINLIST = WINLIST;
-
+
winMenu->clear();
LXCB::WINDOWVISIBILITY showstate = LXCB::IGNORE;
for(int i=0; i<WINLIST.length(); i++){
@@ -98,7 +99,7 @@ void LTaskButton::UpdateButton(){
//Update the button visuals from the first window
this->setIcon(WINLIST[i].icon(noicon));
cname = WINLIST[i].Class();
- if(cname.isEmpty()){
+ if(cname.isEmpty()){
//Special case (chrome/chromium does not register *any* information with X except window title)
cname = WINLIST[i].text();
if(cname.contains(" - ")){ cname = cname.section(" - ",-1); }
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
index 6b171c6a..ff551998 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h
@@ -15,6 +15,7 @@
#include <QMenu>
#include <QEvent>
#include <QAction>
+#include <QTimer>
// libLumina includes
#include <LuminaXDG.h>
@@ -29,7 +30,7 @@ class LTaskButton : public LTBWidget{
public:
LTaskButton(QWidget *parent=0, bool smallDisplay = true);
~LTaskButton();
-
+
//Window Information
QList<WId> windows();
QString classname();
@@ -56,6 +57,7 @@ public slots:
void UpdateMenus(); //re-create the menus (text + icons)
private slots:
+
void buttonClicked();
void closeWindow(); //send the signal to close a window
void maximizeWindow(); //send the signal to maximize/restore a window
@@ -66,7 +68,14 @@ private slots:
void triggerWindow(); //change b/w visible and invisible
void winClicked(QAction*);
void openActionMenu();
-
+protected:
+ void changeEvent(QEvent *ev){
+ LTBWidget::changeEvent(ev);
+ QEvent::Type tmp = ev->type();
+ if(tmp==QEvent::ThemeChange || tmp==QEvent::LanguageChange || tmp==QEvent::LocaleChange){
+ QTimer::singleShot(qrand()%100+500, this, SLOT(UpdateButton()) );
+ }
+ }
signals:
void MenuClosed();
};
bgstack15