mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
add charging icons
Change-Id: I6a2b7d37b833c58e2dbe799edc5559f96995c4b3
This commit is contained in:
parent
476807bb11
commit
e6d5687356
Notes:
Deepin Code Review
2018-01-04 17:35:03 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: Hualet Wang <mr.asianwang@gmail.com> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Thu, 04 Jan 2018 17:35:02 +0800 Reviewed-on: https://cr.deepin.io/29905 Project: dde/dde-dock Branch: refs/heads/master
@ -92,14 +92,9 @@ QPixmap PowerStatusWidget::getBatteryIcon()
|
||||
percentageStr = "000";
|
||||
}
|
||||
|
||||
QString iconStr;
|
||||
|
||||
if (plugged) {
|
||||
iconStr = "battery-charged-symbolic";
|
||||
} else {
|
||||
iconStr = QString("battery-%1-symbolic").arg(percentageStr);
|
||||
}
|
||||
|
||||
const QString iconStr = QString("battery-%1-%2")
|
||||
.arg(percentageStr)
|
||||
.arg(plugged ? "plugged-symbolic" : "symbolic");
|
||||
const auto ratio = devicePixelRatioF();
|
||||
QPixmap pix = QIcon::fromTheme(iconStr).pixmap(QSize(16, 16) * ratio);
|
||||
pix.setDevicePixelRatio(ratio);
|
||||
|
Loading…
x
Reference in New Issue
Block a user