aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h
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/panel-plugins/battery/LBattery.h
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/panel-plugins/battery/LBattery.h')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h15
1 files changed, 12 insertions, 3 deletions
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
bgstack15