fix positioning
This commit is contained in:
parent
4e63016e0d
commit
14bebb0c68
@ -1,30 +1,15 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell.Services.UPower
|
||||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import "../../"
|
||||
import "../settings/"
|
||||
import QtQuick.Layouts
|
||||
|
||||
Loader {
|
||||
id: root
|
||||
visible: UPower.displayDevice.isLaptopBattery
|
||||
active: UPower.displayDevice.isLaptopBattery
|
||||
width: masterLayout.implicitWidth
|
||||
height: 34
|
||||
ColumnLayout {
|
||||
id: masterLayout
|
||||
spacing: 0
|
||||
Row {
|
||||
spacing: 5
|
||||
Text {
|
||||
id: topText
|
||||
font.weight: 900
|
||||
font.family: Settings.font
|
||||
font.pixelSize: Settings.fontSize
|
||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||
color: Colors.foreground
|
||||
}
|
||||
Icons {
|
||||
property bool isCharging: UPower.displayDevice.state === UPowerDeviceState.Charging
|
||||
function getBatteryIcon() {
|
||||
if (isCharging) {
|
||||
@ -55,7 +40,22 @@ Loader {
|
||||
return "battery_android_full";
|
||||
}
|
||||
}
|
||||
text: getBatteryIcon()
|
||||
ColumnLayout {
|
||||
id: masterLayout
|
||||
implicitWidth: botText.width
|
||||
spacing: 0
|
||||
Row {
|
||||
spacing: 5
|
||||
Text {
|
||||
id: topText
|
||||
font.weight: 900
|
||||
font.family: Settings.font
|
||||
font.pixelSize: Settings.fontSize
|
||||
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
|
||||
color: Colors.foreground
|
||||
}
|
||||
Icons {
|
||||
text: root.getBatteryIcon()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
|
||||
@ -6,7 +6,7 @@ import "../../"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: powerLayout.implicitWidth + 10
|
||||
implicitWidth: powerLayout.implicitWidth
|
||||
implicitHeight: 34
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
@ -53,9 +53,11 @@ Loader {
|
||||
id: styleLayout
|
||||
anchors.centerIn: parent
|
||||
spacing: 0
|
||||
implicitWidth: topText.width + icon.width
|
||||
Row {
|
||||
spacing: 2
|
||||
Text {
|
||||
id: topText
|
||||
PwObjectTracker {
|
||||
objects: Pipewire.ready ? root.sink : []
|
||||
}
|
||||
@ -66,6 +68,7 @@ Loader {
|
||||
text: Pipewire.ready ? Math.round(root.sink.audio.volume * 100) + "%" : "0%"
|
||||
}
|
||||
Icons {
|
||||
id: icon
|
||||
text: root.getVolumeIcon()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user