qol: bar has blur now
This commit is contained in:
@@ -145,6 +145,7 @@
|
|||||||
];
|
];
|
||||||
layerrule = [
|
layerrule = [
|
||||||
"match:namespace ^(notifications)$, no_screen_share true"
|
"match:namespace ^(notifications)$, no_screen_share true"
|
||||||
|
"match:namespace ^(quickshell)$, blur true"
|
||||||
];
|
];
|
||||||
# exec-once = [
|
# exec-once = [
|
||||||
# ];
|
# ];
|
||||||
|
|||||||
@@ -15,7 +15,13 @@ Rectangle {
|
|||||||
property int battPercent: 58
|
property int battPercent: 58
|
||||||
implicitWidth: itemContent.width + 8
|
implicitWidth: itemContent.width + 8
|
||||||
implicitHeight: 24
|
implicitHeight: 24
|
||||||
visible: {if (UPower.displayDevice.ready) { true } else {false}}
|
visible: {
|
||||||
|
if (UPower.displayDevice.ready) {
|
||||||
|
true;
|
||||||
|
} else {
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
}
|
||||||
radius: 5.5
|
radius: 5.5
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
color: "#2a2a2a" // Define item color
|
color: "#2a2a2a" // Define item color
|
||||||
@@ -26,17 +32,20 @@ Rectangle {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
Text {
|
Text {
|
||||||
// anchors.centerIn: parent
|
// anchors.centerIn: parent
|
||||||
text: UPower.displayDevice.percentage + "%"
|
text: UPower.displayDevice.percentage * 100 + "%"
|
||||||
color: Common.Colors.colors.primary
|
color: Common.Colors.colors.primary
|
||||||
font.weight: Font.DemiBold
|
font.weight: Font.DemiBold
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
implicitWidth: icon.width
|
||||||
|
implicitHeight: icon.height
|
||||||
Text {
|
Text {
|
||||||
|
id: icon
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: root.getBatteryState(UPower.displayDevice.percentage, (UPower.displayDevice.changeRate > 0))
|
text: root.getBatteryState(UPower.displayDevice.percentage * 100, (UPower.displayDevice.changeRate))
|
||||||
color: root.getBatteryColor(UPower.displayDevice.percentage)
|
color: root.getBatteryColor(UPower.displayDevice.percentage * 100)
|
||||||
font.weight: Font.DemiBold
|
font.weight: Font.DemiBold
|
||||||
font.pointSize: 24 / 1.4
|
font.pointSize: 24 / 1.4
|
||||||
}
|
}
|
||||||
@@ -55,7 +64,8 @@ function getBatteryState(level, isCharging) {
|
|||||||
|
|
||||||
// Calculate step as a value between 1 and 10 (divide level into 10 ranges)
|
// Calculate step as a value between 1 and 10 (divide level into 10 ranges)
|
||||||
let step = Math.ceil(level / 10); // Range mapping
|
let step = Math.ceil(level / 10); // Range mapping
|
||||||
if (step > 10) step = 10; // Clamp to 10 if it exceeds bounds
|
if (step > 10)
|
||||||
|
step = 10; // Clamp to 10 if it exceeds bounds
|
||||||
|
|
||||||
// Return the correct icon based on state
|
// Return the correct icon based on state
|
||||||
return isCharging ? Common.Icons.battery.charging[String(step)] : Common.Icons.battery[String(step)];
|
return isCharging ? Common.Icons.battery.charging[String(step)] : Common.Icons.battery[String(step)];
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Singleton {
|
|||||||
// speaker: "../../../assets/bar/V2/speaker.svg",
|
// speaker: "../../../assets/bar/V2/speaker.svg",
|
||||||
// speakerOff: "../../../assets/bar/V2/speakerOff.svg"
|
// speakerOff: "../../../assets/bar/V2/speakerOff.svg"
|
||||||
// })
|
// })
|
||||||
|
// TODO replace all these icons with svg's
|
||||||
readonly property var battery: ({
|
readonly property var battery: ({
|
||||||
"0": "",
|
"0": "",
|
||||||
"1": "",
|
"1": "",
|
||||||
@@ -34,7 +35,7 @@ Singleton {
|
|||||||
"7": "",
|
"7": "",
|
||||||
"8": "",
|
"8": "",
|
||||||
"9": "",
|
"9": "",
|
||||||
"10": "",
|
"10": ""
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user