safer property access + style adjustments

This commit is contained in:
end-4
2025-04-21 21:31:33 +02:00
parent 99b9de9d5c
commit 5dc0dc133d
12 changed files with 12 additions and 10 deletions
-1
View File
@@ -80,7 +80,6 @@ Scope {
renderType: Text.NativeRendering renderType: Text.NativeRendering
font.family: "Rubik" font.family: "Rubik"
font.pointSize: 14 font.pointSize: 14
// color: Appearance.colors.colOnBackground
text: root.failed ? "Quickshell: Reload failed" : "Quickshell reloaded" text: root.failed ? "Quickshell: Reload failed" : "Quickshell reloaded"
color: failed ? "#ff93000A" : "#ff0C1F13" color: failed ? "#ff93000A" : "#ff0C1F13"
} }
@@ -1,4 +1,4 @@
import "root:/modules/common" import "root:/modules/common/"
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
@@ -7,5 +7,5 @@ Text {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.family: Appearance.font.family.iconMaterial font.family: Appearance.font.family.iconMaterial
font.pixelSize: Appearance.font.pixelSize.small font.pixelSize: Appearance.font.pixelSize.small
color: Appearance.colors.colOnBackground color: Appearance.m3colors.m3onBackground
} }
@@ -381,7 +381,6 @@ Item {
contentItem: MaterialSymbol { contentItem: MaterialSymbol {
anchors.centerIn: parent anchors.centerIn: parent
// text: expanded ? "keyboard_arrow_up" : "keyboard_arrow_down"
text: "keyboard_arrow_down" text: "keyboard_arrow_down"
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@@ -36,7 +36,7 @@ Scope {
} }
Connections { Connections {
target: Audio.sink.audio target: Audio.sink?.audio
function onVolumeChanged() { function onVolumeChanged() {
if (!Audio.ready) return if (!Audio.ready) return
root.showOsdValues = false root.showOsdValues = false
@@ -28,7 +28,7 @@ Scope {
} }
Connections { Connections {
target: Audio.sink.audio target: Audio.sink?.audio
function onVolumeChanged() { function onVolumeChanged() {
if (!Audio.ready) return if (!Audio.ready) return
root.triggerOsd() root.triggerOsd()
@@ -97,7 +97,7 @@ Scope {
OsdValueIndicator { OsdValueIndicator {
id: osdValues id: osdValues
anchors.centerIn: parent anchors.centerIn: parent
value: Audio.sink.audio.volume value: Audio.sink?.audio.volume
icon: "volume_up" icon: "volume_up"
name: "Volume" name: "Volume"
} }
@@ -38,6 +38,7 @@ Item {
Layout.leftMargin: valueIndicatorLeftPadding Layout.leftMargin: valueIndicatorLeftPadding
Layout.topMargin: valueIndicatorVerticalPadding Layout.topMargin: valueIndicatorVerticalPadding
Layout.bottomMargin: valueIndicatorVerticalPadding Layout.bottomMargin: valueIndicatorVerticalPadding
color: Appearance.colors.colOnLayer0
text: root.icon text: root.icon
font.pixelSize: 30 font.pixelSize: 30
} }
@@ -200,7 +200,7 @@ Scope {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
implicitHeight: sessionSubtitle.implicitHeight + 10 * 2 implicitHeight: sessionSubtitle.implicitHeight + 10 * 2
implicitWidth: sessionSubtitle.implicitWidth + 10 * 2 implicitWidth: sessionSubtitle.implicitWidth + 15 * 2
color: Appearance.colors.colTooltip color: Appearance.colors.colTooltip
clip: true clip: true
@@ -53,6 +53,7 @@ Button {
contentItem: MaterialSymbol { contentItem: MaterialSymbol {
id: icon id: icon
anchors.fill: parent anchors.fill: parent
color: Appearance.colors.colOnLayer2
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: buttonIcon text: buttonIcon
font.pixelSize: 40 font.pixelSize: 40
@@ -110,7 +110,7 @@ Rectangle {
SwipeView { SwipeView {
id: swipeView id: swipeView
Layout.topMargin: 10 Layout.topMargin: 5
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
currentIndex: currentTab currentIndex: currentTab
@@ -91,6 +91,7 @@ Scope {
Layout.fillHeight: false Layout.fillHeight: false
spacing: 10 spacing: 10
Layout.margins: 10 Layout.margins: 10
Layout.topMargin: 5
Layout.bottomMargin: 0 Layout.bottomMargin: 0
CustomIcon { CustomIcon {
@@ -37,6 +37,7 @@ Button {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: false Layout.fillWidth: false
Layout.leftMargin: 5 Layout.leftMargin: 5
color: Appearance.colors.colOnLayer2
font.pixelSize: Appearance.font.pixelSize.hugeass font.pixelSize: Appearance.font.pixelSize.hugeass
text: input ? "mic_external_on" : "media_output" text: input ? "mic_external_on" : "media_output"
} }
+1 -1
View File
@@ -7,7 +7,7 @@ pragma ComponentBehavior: Bound
Singleton { Singleton {
id: root id: root
property bool ready: Pipewire.defaultAudioSink.ready property bool ready: Pipewire.defaultAudioSink?.ready
property var sink: Pipewire.defaultAudioSink property var sink: Pipewire.defaultAudioSink
property var source: Pipewire.defaultAudioSource property var source: Pipewire.defaultAudioSource