add charging indicator for statusIcons
This commit is contained in:
parent
051c1815b3
commit
32a385bfb7
15
:w
Normal file
15
:w
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import QtQuick
|
||||||
|
import "../settings/"
|
||||||
|
import "../"
|
||||||
|
|
||||||
|
Text {
|
||||||
|
property real fill
|
||||||
|
font.family: "Material Symbols Rounded"
|
||||||
|
color: Colors.foreground
|
||||||
|
font.pixelSize: Settings.config.fontSize + 2
|
||||||
|
font.variableAxes: {
|
||||||
|
wght: 700,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -28,9 +28,7 @@ Variants {
|
|||||||
property var screen: root.modelData
|
property var screen: root.modelData
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
}
|
}
|
||||||
Title {
|
Title {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|||||||
@ -19,11 +19,10 @@ Loader {
|
|||||||
property bool frame4: UPower.displayDevice.percentage < 0.74
|
property bool frame4: UPower.displayDevice.percentage < 0.74
|
||||||
property bool frame5: UPower.displayDevice.percentage < 0.90
|
property bool frame5: UPower.displayDevice.percentage < 0.90
|
||||||
property bool frame6: UPower.displayDevice.percentage <= 1
|
property bool frame6: UPower.displayDevice.percentage <= 1
|
||||||
property bool charging: UPower.displayDevice.Charging
|
|
||||||
|
|
||||||
function getBatteryIcon() {
|
function getBatteryIcon() {
|
||||||
if (charging) {
|
if (UPower.displayDevice.state == UPowerDeviceState.Charging) {
|
||||||
return "battery_android_frame_bolt"
|
return "battery_android_frame_bolt";
|
||||||
}
|
}
|
||||||
if (frame1) {
|
if (frame1) {
|
||||||
return "battery_android_frame_1";
|
return "battery_android_frame_1";
|
||||||
@ -49,8 +48,8 @@ Loader {
|
|||||||
implicitHeight: Settings.config.barHeight
|
implicitHeight: Settings.config.barHeight
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.centerIn: parent
|
|
||||||
id: batRow
|
id: batRow
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 5
|
spacing: 5
|
||||||
CustomText {
|
CustomText {
|
||||||
id: batText
|
id: batText
|
||||||
@ -60,7 +59,6 @@ Loader {
|
|||||||
id: batIcon
|
id: batIcon
|
||||||
text: root.getBatteryIcon()
|
text: root.getBatteryIcon()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
implicitWidth: trayRow.implicitWidth
|
implicitWidth: trayRow.implicitWidth
|
||||||
implicitHeight: Settings.config.barHeight
|
implicitHeight: Settings.config.barHeight
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: trayRow
|
id: trayRow
|
||||||
|
|||||||
@ -33,18 +33,20 @@ Item {
|
|||||||
implicitWidth: textRow.implicitWidth + 10
|
implicitWidth: textRow.implicitWidth + 10
|
||||||
implicitHeight: Settings.config.barHeight
|
implicitHeight: Settings.config.barHeight
|
||||||
Row {
|
Row {
|
||||||
|
id: textRow
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 5
|
spacing: 5
|
||||||
id: textRow
|
|
||||||
CustomText {
|
CustomText {
|
||||||
id: volumeText
|
id: volumeText
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
|
||||||
}
|
}
|
||||||
text: Pipewire.ready ? Math.round(root.sink.audio.volume * 100) + "%" : "failure"
|
text: Pipewire.ready ? Math.round(root.sink.audio.volume * 100) + "%" : "failure"
|
||||||
|
opacity: root.sink.audio.muted ? 0.5 : 1
|
||||||
}
|
}
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
id: volumeIcon
|
id: volumeIcon
|
||||||
|
opacity: root.sink.audio.muted ? 0.5 : 1
|
||||||
text: root.getVolumeIcon()
|
text: root.getVolumeIcon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,5 +7,9 @@ Text {
|
|||||||
font.family: "Material Symbols Rounded"
|
font.family: "Material Symbols Rounded"
|
||||||
color: Colors.foreground
|
color: Colors.foreground
|
||||||
font.pixelSize: Settings.config.fontSize + 2
|
font.pixelSize: Settings.config.fontSize + 2
|
||||||
font.weight: 500
|
font.variableAxes: ({
|
||||||
|
FILL: fill.toFixed(1),
|
||||||
|
GRAD: 200,
|
||||||
|
wght: 400
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,11 @@ import "../settings/"
|
|||||||
import "../"
|
import "../"
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
font.weight: 900
|
|
||||||
color: Colors.foreground
|
color: Colors.foreground
|
||||||
font.family: Settings.config.font
|
font.family: Settings.config.font
|
||||||
font.pixelSize: Settings.config.fontSize
|
font.pixelSize: Settings.config.fontSize
|
||||||
|
font.variableAxes: ({
|
||||||
|
GRAD: 200,
|
||||||
|
wght: 400
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,8 @@ Singleton {
|
|||||||
id: settingsAdapter
|
id: settingsAdapter
|
||||||
property var currentWall: "/home/lucy/.walls/faris.jpg"
|
property var currentWall: "/home/lucy/.walls/faris.jpg"
|
||||||
property var barHeight: 28
|
property var barHeight: 28
|
||||||
property var font: "JetBrainsMono Nerd Font"
|
property var font: "SauceCodePro Nerd Font Mono"
|
||||||
property var fontSize: 12
|
property var fontSize: 14
|
||||||
property var rounding: 10
|
property var rounding: 10
|
||||||
property var wallDir: "/home/lucy/.walls"
|
property var wallDir: "/home/lucy/.walls"
|
||||||
property bool floating: true
|
property bool floating: true
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
"barHeight": 28,
|
"barHeight": 28,
|
||||||
"currentWall": "/home/lucy/.walls/faris.jpg",
|
"currentWall": "/home/lucy/.walls/faris.jpg",
|
||||||
"floating": true,
|
"floating": true,
|
||||||
"font": "JetBrainsMono Nerd Font",
|
"font": "SauceCodePro Nerd Font Mono",
|
||||||
"fontSize": 12,
|
"fontSize": 14,
|
||||||
"paddingSides": 10,
|
"paddingSides": 10,
|
||||||
"paddingTop": 10,
|
"paddingTop": 10,
|
||||||
"rounding": 10,
|
"rounding": 10,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user