diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/battery')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp | 2 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.h | 15 |
2 files changed, 13 insertions, 4 deletions
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 |