replace wraperRectangle with normal rectangle
This commit is contained in:
parent
bc0fab6cb0
commit
a62d313b29
9 changed files with 77 additions and 38 deletions
|
|
@ -6,15 +6,16 @@ import qs
|
|||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
Rectangle {
|
||||
id: root
|
||||
clip: true
|
||||
color: Colors.base01
|
||||
property double percent: UPower.displayDevice.percentage * 100
|
||||
property bool hasBattery: UPower.displayDevice.isLaptopBattery
|
||||
property bool charging: UPower.displayDevice.state == UPowerDeviceState.Charging
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
required property double moduleHeight
|
||||
implicitHeight: moduleHeight
|
||||
implicitWidth: batLayout.implicitWidth + 16
|
||||
radius: Config.rounding
|
||||
function batteryIcon(percent, charging) {
|
||||
if (percent <= 15)
|
||||
|
|
@ -31,7 +32,9 @@ WrapperRectangle {
|
|||
return charging ? "battery_charging_90" : "battery_6_bar";
|
||||
return charging ? "battery_charging_full" : "battery_full";
|
||||
}
|
||||
child: RowLayout {
|
||||
RowLayout {
|
||||
id: batLayout
|
||||
anchors.centerIn: root
|
||||
MaterialIcon {
|
||||
text: root.batteryIcon(root.percent, root.charging)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue