splitted the code base into more components and implemented safety measures to Crypto.qml, also added missing themes and removed hardcoded values

This commit is contained in:
SomeElse
2026-05-17 01:17:01 +00:00
parent c8343398f9
commit 262fd8afa0
26 changed files with 344 additions and 295 deletions

View File

@@ -13,7 +13,7 @@ ModuleChip {
readonly property var bat: UPower.displayDevice
readonly property bool batReady: bat && bat.ready && bat.isLaptopBattery
readonly property bool moduleEnabled: false
readonly property bool moduleEnabled: batReady
readonly property real pct: batReady ? bat.percentage * 100 : 72
readonly property int state: batReady ? bat.state : UPowerDeviceState.Unknown
@@ -173,37 +173,19 @@ ModuleChip {
Behavior on opacity { NumberAnimation { duration: 200 } }
}
Rectangle {
PopupCard {
id: card
width: parent.width
popupOpen: batteryPopup.popupOpen
isTop: root.isTop
animEnabled: batteryPopup.visible
height: cardCol.implicitHeight + 28
anchors.top: root.isTop ? parent.top : undefined
anchors.bottom: root.isTop ? undefined : parent.bottom
transform: Translate {
y: batteryPopup.popupOpen ? 0
: (root.isTop ? -card.height : card.height)
Behavior on y {
NumberAnimation {
duration: Cfg.Config.popupAnimDuration
easing.type: Easing.OutExpo
}
enabled: batteryPopup.visible
}
}
opacity: batteryPopup.popupOpen ? 1.0 : 0.0
Behavior on opacity { NumberAnimation { duration: 220 } }
color: root.t.batPopupBg
radius: Cfg.Config.popupRadius
border.color: root.t.batPopupBorder
border.width: Cfg.Config.popupBorderWidth
layer.enabled: true
MouseArea { anchors.fill: parent; propagateComposedEvents: false }
ColumnLayout {
id: cardCol
anchors {