aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-11-30 13:08:30 -0500
committerKen Moore <ken@ixsystems.com>2016-11-30 13:08:30 -0500
commitd4f8bc41d53b85b1d3639fdc129f369e7f1b581e (patch)
tree77038edd76a52de551c8180612c127de8cb61d6d /src-qt5
parentGet rid of the whitespace between mimetype registrations in the lumina-archiv... (diff)
downloadlumina-d4f8bc41d53b85b1d3639fdc129f369e7f1b581e.tar.gz
lumina-d4f8bc41d53b85b1d3639fdc129f369e7f1b581e.tar.bz2
lumina-d4f8bc41d53b85b1d3639fdc129f369e7f1b581e.zip
Unify the icons used for battery indications within the start menu and battery plugin.
Also, add a green background to the battery plugin when the charge is 100% and still plugged in.
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp3
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp9
2 files changed, 6 insertions, 6 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 af081191..ee379613 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/battery/LBattery.cpp
@@ -1,6 +1,6 @@
//===========================================
// Lumina-DE source code
-// Copyright (c) 2014, Susanne Jaeckel
+// Copyright (c) 2014, Susanne Jaeckel, 2015-2016 Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
@@ -81,6 +81,7 @@ void LBattery::updateBattery(bool force){
LSession::handle()->playAudioFile(LOS::LuminaShare()+"low-battery.ogg");
}
if(icon==0){ label->setStyleSheet("QLabel{ background: red;}"); }
+ else if(icon==14 && charge>98){ label->setStyleSheet("QLabel{ background: green;}"); }
else{ label->setStyleSheet("QLabel{ background: transparent;}"); }
iconOld = icon;
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
index 260215ec..a34d09db 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
@@ -488,11 +488,10 @@ void StartMenu::on_stackedWidget_currentChanged(int val){
//Battery available - update the status button
int charge = LOS::batteryCharge();
QString TT, ICON;
- if(charge < 10){ ICON="-low"; }
- else if(charge<20){ ICON="-caution"; }
- else if(charge<40){ ICON="-040"; }
- else if(charge<60){ ICON="-060"; }
- else if(charge<80){ ICON="-080"; }
+ if(charge<=5){ ICON="-caution"; }
+ else if(charge<=20){ ICON="-040"; }
+ else if(charge<=70){ ICON="-060"; }
+ else if(charge<=90){ ICON="-080"; }
else{ ICON="-100"; }
if(LOS::batteryIsCharging()){
if(charge>=80){ ICON.clear(); } //for charging, there is no suffix to the icon name over 80%
bgstack15