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
+3 -3
View File
@@ -20,15 +20,15 @@ CustomMouseArea {
required property PersistentProperties visibilities
function inBottomPanel(panel: Item, x: real, y: real): bool {
return y > root.height - panel.height && withinPanelWidth(panel, x, y);
return y > root.height - panel.height - Config.barConfig.border && withinPanelWidth(panel, x, y);
}
function inLeftPanel(panel: Item, x: real, y: real): bool {
return x < panel.x + panel.width && withinPanelHeight(panel, x, y);
return x < panel.x + panel.width + Config.barConfig.border && withinPanelHeight(panel, x, y);
}
function inRightPanel(panel: Item, x: real, y: real): bool {
return x > panel.x && withinPanelHeight(panel, x, y);
return x > panel.x - Config.barConfig.border && withinPanelHeight(panel, x, y);
}
function inTopPanel(panel: Item, x: real, y: real): bool {
+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 {
}
}
}
+4
View File
@@ -72,6 +72,9 @@ Item {
}
}
CustomClippingRect {
anchors.fill: parent
Loader {
id: content
@@ -85,4 +88,5 @@ Item {
visibilities: root.visibilities
}
}
}
}
+4
View File
@@ -113,6 +113,9 @@ Item {
}
}
CustomClippingRect {
anchors.fill: parent
Loader {
id: content
@@ -131,4 +134,5 @@ Item {
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