fix icon centering issue fr

This commit is contained in:
lucy 2026-02-01 23:59:09 +01:00
parent 52a52b7aa2
commit 1eeff4798e
4 changed files with 21 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import Quickshell.Services.UPower
import QtQuick.Layouts
import QtQuick
import Quickshell.Widgets
import Qt5Compat.GraphicalEffects
@ -68,17 +69,20 @@ Loader {
implicitWidth: batRow.width
implicitHeight: Settings.config.barHeight
Row {
RowLayout {
id: batRow
anchors.verticalCenter: parent.verticalCenter
spacing: 5
CustomText {
id: batText
Layout.topMargin: 2
anchors.verticalCenter: parent.verticalCenter
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
}
CustomIcon {
id: batIcon
Layout.topMargin: 2
font.family: "Material Symbols Rounded"
text: root.getBatteryIcon()
}

View File

@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Layouts
import Quickshell.Services.Mpris
import qs
import qs.settings
@ -26,7 +27,7 @@ Rectangle {
implicitWidth: statusRow.implicitWidth
implicitHeight: statusRow.implicitHeight
Row {
RowLayout {
id: statusRow
spacing: 5
anchors.verticalCenter: parent.verticalCenter
@ -34,10 +35,12 @@ Rectangle {
property var status: root.spotify != null ? !root.spotify.isPlaying ? "play_arrow" : "pause" : ""
CustomText {
id: mprisText
Layout.topMargin: 2
text: root.spotify != null ? parent.combinedText : ""
}
CustomIcon {
id: mprisStatus
Layout.topMargin: 2
text: root.spotify != null ? parent.status : ""
}
}

View File

@ -42,6 +42,7 @@ Rectangle {
anchors.centerIn: parent
CustomText {
id: volumeText
Layout.topMargin: 2
PwObjectTracker {
objects: Pipewire.ready ? Pipewire.defaultAudioSink : []
@ -51,6 +52,7 @@ Rectangle {
}
CustomIcon {
id: volumeIcon
Layout.topMargin: 2
Layout.alignment: Qt.AlignVCenter
opacity: Pipewire.ready ? root.sink.audio.muted ? 0.5 : 1 : 0
text: Pipewire.ready ? root.getVolumeIcon() : null

View File

@ -35,8 +35,9 @@ FloatingWindow {
ColumnLayout {
id: windowLayout
spacing: 10
spacing: 5
anchors.fill: parent
anchors.margins: 5
Rectangle {
id: textWrapper
@ -44,7 +45,10 @@ FloatingWindow {
Layout.margins: 10
Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: 0
radius: 14
topLeftRadius: 12
topRightRadius: 12
bottomLeftRadius: 4
bottomRightRadius: 4
implicitHeight: 30
color: Colors.surfaceContainerLow
CustomText {
@ -61,7 +65,10 @@ FloatingWindow {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 10
radius: 14
topLeftRadius: 4
topRightRadius: 4
bottomLeftRadius: 12
bottomRightRadius: 12
color: Colors.surfaceContainerLow
GridView {
id: gridRoot