aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2020-04-24 19:46:53 -0400
committerKen Moore <moorekou@gmail.com>2020-04-24 19:46:53 -0400
commita12bd680f39a0503cb93413d3420fd80158835d9 (patch)
tree831243bb1c126498df9fcf520f26757c4bcc2ab1 /src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
parentMore updates. (diff)
downloadlumina-a12bd680f39a0503cb93413d3420fd80158835d9.tar.gz
lumina-a12bd680f39a0503cb93413d3420fd80158835d9.tar.bz2
lumina-a12bd680f39a0503cb93413d3420fd80158835d9.zip
Some more updates to the desktop.
Get the screensaver checks working
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
index 56ad0788..83aaceea 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
@@ -92,22 +92,11 @@ void LSysMenuQuick::UpdateMenu(){
if(hasBat){
ui->group_battery->setVisible(true);
val = LOS::batteryCharge();
- if(LOS::batteryIsCharging()){
- if(val < 15){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging-low","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 30){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging-caution","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 50){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging-040","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 70){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging-060","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 90){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging-080","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else{ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-charging","").pixmap(ui->label_bat_icon->maximumSize()) ); }
+ bool charging = LOS::batteryIsCharging();
+ ui->label_bat_icon->setPixmap( LXDG::findIcon(LSession::batteryIconName(val,charging), "").pixmap(ui->label_bat_icon->maximumSize()) );
+ if(charging){
ui->label_bat_text->setText( QString("%1%\n(%2)").arg(QString::number(val), tr("connected")) );
}else{
- if(val < 1){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-missing","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 15){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-low","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 30){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-caution","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 50){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-040","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 70){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-060","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else if(val < 90){ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-080","").pixmap(ui->label_bat_icon->maximumSize()) ); }
- else{ ui->label_bat_icon->setPixmap( LXDG::findIcon("battery-100","").pixmap(ui->label_bat_icon->maximumSize()) ); }
ui->label_bat_text->setText( QString("%1%\n(%2)").arg(QString::number(val), getRemainingTime()) );
}
}else{
bgstack15