New battery health design

pull/26/head
reionwong 4 years ago
parent fbc6985e9b
commit 194936e5e6

@ -194,24 +194,19 @@ ItemPage {
height: _poorLabel.implicitHeight + 4 + FishUI.Units.smallSpacing height: _poorLabel.implicitHeight + 4 + FishUI.Units.smallSpacing
width: _poorLabel.implicitWidth + FishUI.Units.largeSpacing width: _poorLabel.implicitWidth + FishUI.Units.largeSpacing
Label { Rectangle {
id: _poorLabel id: _poorRect
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
text: qsTr("Poor")
color: "#FF8738" color: "#FF8738"
radius: FishUI.Theme.mediumRadius
visible: battery.capacity >= 0 && battery.capacity <= 79
} }
Rectangle { Label {
id: _poorLine id: _poorLabel
anchors.top: _poorLabel.bottom anchors.centerIn: parent
anchors.left: parent.left text: qsTr("Poor")
anchors.right: parent.right color: _poorRect.visible ? "#FFFFFF" : "#FF8738"
anchors.bottom: parent.bottom
anchors.topMargin: FishUI.Units.smallSpacing
height: 2
radius: 2
color: _poorLabel.color
visible: battery.capacity >= 0 && battery.capacity <= 79
} }
} }
@ -223,24 +218,19 @@ ItemPage {
height: _normalLabel.implicitHeight + 4 + FishUI.Units.smallSpacing height: _normalLabel.implicitHeight + 4 + FishUI.Units.smallSpacing
width: _normalLabel.implicitWidth + FishUI.Units.largeSpacing width: _normalLabel.implicitWidth + FishUI.Units.largeSpacing
Label { Rectangle {
id: _normalLabel id: _normalRect
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
text: qsTr("Normal")
color: "#3385FF" color: "#3385FF"
radius: FishUI.Theme.mediumRadius
visible: battery.capacity >= 80 && battery.capacity <= 89
} }
Rectangle { Label {
id: _normalLine id: _normalLabel
anchors.top: _normalLabel.bottom anchors.centerIn: parent
anchors.left: parent.left text: qsTr("Normal")
anchors.right: parent.right color: _normalRect.visible ? "#FFFFFF" : "#3385FF"
anchors.bottom: parent.bottom
anchors.topMargin: FishUI.Units.smallSpacing
height: 2
radius: 2
color: _normalLabel.color
visible: battery.capacity >= 80 && battery.capacity <= 89
} }
} }
@ -252,24 +242,19 @@ ItemPage {
height: _excellentLabel.implicitHeight + 4 + FishUI.Units.smallSpacing height: _excellentLabel.implicitHeight + 4 + FishUI.Units.smallSpacing
width: _excellentLabel.implicitWidth + FishUI.Units.largeSpacing width: _excellentLabel.implicitWidth + FishUI.Units.largeSpacing
Label { Rectangle {
id: _excellentLabel id: _excellentRect
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
text: qsTr("Excellent")
color: "#00CD23" color: "#00CD23"
radius: FishUI.Theme.mediumRadius
visible: battery.capacity >= 90 && battery.capacity <= 100
} }
Rectangle { Label {
id: _excellentLine id: _excellentLabel
anchors.top: _excellentLabel.bottom anchors.centerIn: parent
anchors.left: parent.left text: qsTr("Excellent")
anchors.right: parent.right color: _excellentRect.visible ? "#FFFFFF" : "#00CD23"
anchors.bottom: parent.bottom
anchors.topMargin: FishUI.Units.smallSpacing
height: 2
radius: 2
color: _excellentLabel.color
visible: battery.capacity >= 90 && battery.capacity <= 100
} }
} }
} }

@ -190,6 +190,7 @@ RoundedItem {
text: qsTr("Delete this user") text: qsTr("Delete this user")
enabled: model.userId !== loggedUser.userId enabled: model.userId !== loggedUser.userId
onClicked: accountsManager.deleteUser(userId, true) onClicked: accountsManager.deleteUser(userId, true)
backgroundColor: FishUI.Theme.darkMode ? "#363636" : FishUI.Theme.backgroundColor
Layout.fillWidth: true Layout.fillWidth: true
} }
} }

Loading…
Cancel
Save