start of refactor

This commit is contained in:
Zacharias-Brohn
2026-03-09 23:18:13 +01:00
parent 88d795a73f
commit 26bc5cd7c3
6 changed files with 45 additions and 59 deletions
+11 -12
View File
@@ -4,7 +4,7 @@ import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Modules
import qs.Modules as Bar
import qs.Config
import qs.Helpers
import qs.Modules.UPower
@@ -13,7 +13,7 @@ import qs.Modules.Network
RowLayout {
id: root
required property Wrapper popouts
required property Bar.Wrapper popouts
required property ShellScreen screen
readonly property int vPadding: 6
required property PersistentProperties visibilities
@@ -73,7 +73,7 @@ RowLayout {
roleValue: "workspaces"
delegate: WrappedLoader {
sourceComponent: Workspaces {
sourceComponent: Bar.Workspaces {
screen: root.screen
}
}
@@ -83,7 +83,7 @@ RowLayout {
roleValue: "audio"
delegate: WrappedLoader {
sourceComponent: AudioWidget {
sourceComponent: Bar.AudioWidget {
}
}
}
@@ -92,8 +92,7 @@ RowLayout {
roleValue: "tray"
delegate: WrappedLoader {
sourceComponent: TrayWidget {
bar: root.bar
sourceComponent: Bar.TrayWidget {
loader: root
popouts: root.popouts
}
@@ -104,7 +103,7 @@ RowLayout {
roleValue: "resources"
delegate: WrappedLoader {
sourceComponent: Resources {
sourceComponent: Bar.Resources {
visibilities: root.visibilities
}
}
@@ -114,7 +113,7 @@ RowLayout {
roleValue: "updates"
delegate: WrappedLoader {
sourceComponent: UpdatesWidget {
sourceComponent: Bar.UpdatesWidget {
}
}
}
@@ -123,7 +122,7 @@ RowLayout {
roleValue: "notifBell"
delegate: WrappedLoader {
sourceComponent: NotifBell {
sourceComponent: Bar.NotifBell {
popouts: root.popouts
visibilities: root.visibilities
}
@@ -134,7 +133,7 @@ RowLayout {
roleValue: "clock"
delegate: WrappedLoader {
sourceComponent: Clock {
sourceComponent: Bar.Clock {
loader: root
popouts: root.popouts
visibilities: root.visibilities
@@ -146,7 +145,7 @@ RowLayout {
roleValue: "activeWindow"
delegate: WrappedLoader {
sourceComponent: WindowTitle {
sourceComponent: Bar.WindowTitle {
bar: root
}
}
@@ -174,7 +173,7 @@ RowLayout {
roleValue: "media"
delegate: WrappedLoader {
sourceComponent: MediaWidget {
sourceComponent: Bar.MediaWidget {
}
}
}
+13 -9
View File
@@ -72,17 +72,21 @@ Item {
}
}
Loader {
id: content
CustomClippingRect {
anchors.fill: parent
active: true
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
Loader {
id: content
sourceComponent: Content {
state: root.dashState
visibilities: root.visibilities
active: true
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
sourceComponent: Content {
state: root.dashState
visibilities: root.visibilities
}
}
}
}
+18 -14
View File
@@ -113,22 +113,26 @@ Item {
}
}
Loader {
id: content
CustomClippingRect {
anchors.fill: parent
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
Loader {
id: content
sourceComponent: Content {
brightness: root.brightness
monitor: root.monitor
muted: root.muted
sourceMuted: root.sourceMuted
sourceVolume: root.sourceVolume
visibilities: root.visibilities
volume: root.volume
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
sourceComponent: Content {
brightness: root.brightness
monitor: root.monitor
muted: root.muted
sourceMuted: root.sourceMuted
sourceVolume: root.sourceVolume
visibilities: root.visibilities
volume: root.volume
}
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
}
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
}
}
-19
View File
@@ -9,7 +9,6 @@ import qs.Config
Item {
id: root
required property PanelWindow bar
property bool hasLoaded: false
required property int ind
required property SystemTrayItem item
@@ -46,22 +45,4 @@ Item {
layer.enabled: DynamicColors.light
source: root.item.icon
}
// Image {
// id: icon
//
// property bool batteryHDPI: root.bar.screen.x < 0 && root.item.icon.includes("battery")
// property bool nmHDPI: root.bar.screen.x < 0 && root.item.icon.includes("nm-")
//
// anchors.centerIn: parent
// width: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
// height: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
// source: root.item.icon
// mipmap: true
// smooth: ( batteryHDPI || nmHDPI ) ? false : true
// asynchronous: true
// sourceSize.width: ( batteryHDPI || nmHDPI ) ? 16 : 22
// sourceSize.height: ( batteryHDPI || nmHDPI ) ? 16 : 22
// fillMode: Image.PreserveAspectFit
// }
}
-2
View File
@@ -10,7 +10,6 @@ import qs.Config
Item {
id: root
required property PanelWindow bar
readonly property alias items: repeater
required property RowLayout loader
required property Wrapper popouts
@@ -45,7 +44,6 @@ Item {
required property int index
required property SystemTrayItem modelData
bar: root.bar
implicitHeight: 34
implicitWidth: 34
ind: index