summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/BarConfig.qml16
-rw-r--r--config/BorderConfig.qml14
-rw-r--r--config/Config.qml36
-rw-r--r--config/DashboardConfig.qml14
-rw-r--r--config/LauncherConfig.qml24
-rw-r--r--config/NotifsConfig.qml26
-rw-r--r--config/OsdConfig.qml16
-rw-r--r--config/SessionConfig.qml14
-rw-r--r--modules/bar/Bar.qml6
-rw-r--r--modules/bar/components/workspaces/ActiveIndicator.qml16
-rw-r--r--modules/bar/components/workspaces/OccupiedBg.qml6
-rw-r--r--modules/bar/components/workspaces/Workspace.qml16
-rw-r--r--modules/bar/components/workspaces/Workspaces.qml8
-rw-r--r--modules/bar/popouts/ActiveWindow.qml4
-rw-r--r--modules/bar/popouts/Background.qml4
-rw-r--r--modules/bar/popouts/Battery.qml2
-rw-r--r--modules/bar/popouts/TrayMenu.qml4
-rw-r--r--modules/dashboard/Background.qml4
-rw-r--r--modules/dashboard/Dash.qml2
-rw-r--r--modules/dashboard/Media.qml16
-rw-r--r--modules/dashboard/Performance.qml6
-rw-r--r--modules/dashboard/Tabs.qml17
-rw-r--r--modules/dashboard/dash/DateTime.qml2
-rw-r--r--modules/dashboard/dash/Media.qml26
-rw-r--r--modules/dashboard/dash/Resources.qml2
-rw-r--r--modules/dashboard/dash/User.qml4
-rw-r--r--modules/drawers/Backgrounds.qml2
-rw-r--r--modules/drawers/Border.qml6
-rw-r--r--modules/drawers/Drawers.qml8
-rw-r--r--modules/drawers/Exclusions.qml2
-rw-r--r--modules/drawers/Interactions.qml15
-rw-r--r--modules/drawers/Panels.qml4
-rw-r--r--modules/launcher/ActionItem.qml2
-rw-r--r--modules/launcher/Actions.qml4
-rw-r--r--modules/launcher/AppItem.qml2
-rw-r--r--modules/launcher/AppList.qml8
-rw-r--r--modules/launcher/Background.qml4
-rw-r--r--modules/launcher/Content.qml4
-rw-r--r--modules/launcher/ContentList.qml8
-rw-r--r--modules/launcher/WallpaperItem.qml2
-rw-r--r--modules/launcher/WallpaperList.qml6
-rw-r--r--modules/notifications/Background.qml6
-rw-r--r--modules/notifications/Content.qml10
-rw-r--r--modules/notifications/Notification.qml22
-rw-r--r--modules/osd/Background.qml4
-rw-r--r--modules/osd/Content.qml8
-rw-r--r--modules/osd/Interactions.qml2
-rw-r--r--modules/session/Background.qml4
-rw-r--r--modules/session/Content.qml8
-rw-r--r--services/Cava.qml2
-rw-r--r--services/Notifs.qml4
-rw-r--r--utils/Paths.qml1
52 files changed, 231 insertions, 222 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml
index 21f9314..31577c4 100644
--- a/config/BarConfig.qml
+++ b/config/BarConfig.qml
@@ -1,22 +1,14 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
-
-Singleton {
- id: root
-
- readonly property Sizes sizes: Sizes {}
- readonly property Workspaces workspaces: Workspaces {}
-
- component Sizes: QtObject {
+JsonObject {
+ property JsonObject sizes: JsonObject {
property int innerHeight: 30
property int windowPreviewSize: 400
property int trayMenuWidth: 300
property int batteryWidth: 250
}
- component Workspaces: QtObject {
+ property JsonObject workspaces: JsonObject {
property int shown: 5
property bool rounded: true
property bool activeIndicator: true
diff --git a/config/BorderConfig.qml b/config/BorderConfig.qml
index a69cf59..7e95054 100644
--- a/config/BorderConfig.qml
+++ b/config/BorderConfig.qml
@@ -1,13 +1,9 @@
-pragma Singleton
-
import "root:/services"
-import Quickshell
+import Quickshell.Io
import QtQuick
-Singleton {
- id: root
-
- readonly property color colour: Colours.palette.m3surface
- readonly property int thickness: Appearance.padding.normal
- readonly property int rounding: Appearance.rounding.large
+JsonObject {
+ property color colour: Colours.palette.m3surface
+ property int thickness: Appearance.padding.normal
+ property int rounding: Appearance.rounding.large
}
diff --git a/config/Config.qml b/config/Config.qml
new file mode 100644
index 0000000..4605b8f
--- /dev/null
+++ b/config/Config.qml
@@ -0,0 +1,36 @@
+pragma Singleton
+
+import "root:/utils"
+import Quickshell
+import Quickshell.Io
+import QtQuick
+
+Singleton {
+ id: root
+
+ property alias bar: adapter.bar
+ property alias border: adapter.border
+ property alias dashboard: adapter.dashboard
+ property alias launcher: adapter.launcher
+ property alias notifs: adapter.notifs
+ property alias osd: adapter.osd
+ property alias session: adapter.session
+
+ FileView {
+ path: `${Paths.config}/shell.json`
+ watchChanges: true
+ onAdapterUpdated: writeAdapter()
+
+ JsonAdapter {
+ id: adapter
+
+ property JsonObject bar: BarConfig {}
+ property JsonObject border: BorderConfig {}
+ property JsonObject dashboard: DashboardConfig {}
+ property JsonObject launcher: LauncherConfig {}
+ property JsonObject notifs: NotifsConfig {}
+ property JsonObject osd: OsdConfig {}
+ property JsonObject session: SessionConfig {}
+ }
+ }
+}
diff --git a/config/DashboardConfig.qml b/config/DashboardConfig.qml
index 3c32e07..269d4b4 100644
--- a/config/DashboardConfig.qml
+++ b/config/DashboardConfig.qml
@@ -1,14 +1,10 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
+JsonObject {
+ property int mediaUpdateInterval: 500
+ property int visualiserBars: 45
-Singleton {
- readonly property int mediaUpdateInterval: 500
- readonly property int visualiserBars: 45
- readonly property Sizes sizes: Sizes {}
-
- component Sizes: QtObject {
+ property JsonObject sizes: JsonObject {
readonly property int tabIndicatorHeight: 3
readonly property int tabIndicatorSpacing: 5
readonly property int infoWidth: 200
diff --git a/config/LauncherConfig.qml b/config/LauncherConfig.qml
index 18489f7..987e634 100644
--- a/config/LauncherConfig.qml
+++ b/config/LauncherConfig.qml
@@ -1,18 +1,14 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
+JsonObject {
+ property int maxShown: 8
+ property int maxWallpapers: 9 // Warning: even numbers look bad
+ property string actionPrefix: ">"
-Singleton {
- readonly property int maxShown: 8
- readonly property int maxWallpapers: 9 // Warning: even numbers look bad
- readonly property string actionPrefix: ">"
- readonly property Sizes sizes: Sizes {}
-
- component Sizes: QtObject {
- readonly property int itemWidth: 600
- readonly property int itemHeight: 57
- readonly property int wallpaperWidth: 280
- readonly property int wallpaperHeight: 200
+ property JsonObject sizes: JsonObject {
+ property int itemWidth: 600
+ property int itemHeight: 57
+ property int wallpaperWidth: 280
+ property int wallpaperHeight: 200
}
}
diff --git a/config/NotifsConfig.qml b/config/NotifsConfig.qml
index 34b9226..f84def2 100644
--- a/config/NotifsConfig.qml
+++ b/config/NotifsConfig.qml
@@ -1,19 +1,15 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
+JsonObject {
+ property bool expire: false
+ property int defaultExpireTimeout: 3000
+ property real clearThreshold: 0.3
+ property int expandThreshold: 20
+ property bool actionOnClick: false
-Singleton {
- readonly property bool expire: false
- readonly property int defaultExpireTimeout: 3000
- readonly property real clearThreshold: 0.3
- readonly property int expandThreshold: 20
- readonly property bool actionOnClick: false
- readonly property Sizes sizes: Sizes {}
-
- component Sizes: QtObject {
- readonly property int width: 400
- readonly property int image: 41
- readonly property int badge: 20
+ property JsonObject sizes: JsonObject {
+ property int width: 400
+ property int image: 41
+ property int badge: 20
}
}
diff --git a/config/OsdConfig.qml b/config/OsdConfig.qml
index 467d8e7..7275e22 100644
--- a/config/OsdConfig.qml
+++ b/config/OsdConfig.qml
@@ -1,14 +1,10 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
+JsonObject {
+ property int hideDelay: 2000
-Singleton {
- readonly property int hideDelay: 2000
- readonly property Sizes sizes: Sizes {}
-
- component Sizes: QtObject {
- readonly property int sliderWidth: 30
- readonly property int sliderHeight: 150
+ property JsonObject sizes: JsonObject {
+ property int sliderWidth: 30
+ property int sliderHeight: 150
}
}
diff --git a/config/SessionConfig.qml b/config/SessionConfig.qml
index c72d2f1..0915469 100644
--- a/config/SessionConfig.qml
+++ b/config/SessionConfig.qml
@@ -1,13 +1,9 @@
-pragma Singleton
+import Quickshell.Io
-import Quickshell
-import QtQuick
+JsonObject {
+ property int dragThreshold: 30
-Singleton {
- readonly property int dragThreshold: 30
- readonly property Sizes sizes: Sizes {}
-
- component Sizes: QtObject {
- readonly property int button: 80
+ property JsonObject sizes: JsonObject {
+ property int button: 80
}
}
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml
index 2e8ab89..1d0db8d 100644
--- a/modules/bar/Bar.qml
+++ b/modules/bar/Bar.qml
@@ -63,7 +63,7 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
- implicitWidth: child.implicitWidth + BorderConfig.thickness * 2
+ implicitWidth: child.implicitWidth + Config.border.thickness * 2
Item {
id: child
@@ -97,8 +97,8 @@ Item {
MouseArea {
anchors.fill: parent
- anchors.leftMargin: -BorderConfig.thickness
- anchors.rightMargin: -BorderConfig.thickness
+ anchors.leftMargin: -Config.border.thickness
+ anchors.rightMargin: -Config.border.thickness
onWheel: event => {
const activeWs = Hyprland.activeClient?.workspace?.name;
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml
index 3f3ca62..6807397 100644
--- a/modules/bar/components/workspaces/ActiveIndicator.qml
+++ b/modules/bar/components/workspaces/ActiveIndicator.qml
@@ -20,7 +20,7 @@ StyledRect {
property real offset: Math.min(leading, trailing)
property real size: {
const s = Math.abs(leading - trailing) + currentSize;
- if (BarConfig.workspaces.activeTrail && lastWs > currentWsIdx)
+ if (Config.bar.workspaces.activeTrail && lastWs > currentWsIdx)
return Math.min(getWsY(lastWs) + (workspaces[lastWs]?.size ?? 0) - offset, s);
return s;
}
@@ -43,9 +43,9 @@ StyledRect {
clip: true
x: 1
y: offset + 1
- implicitWidth: BarConfig.sizes.innerHeight - 2
+ implicitWidth: Config.bar.sizes.innerHeight - 2
implicitHeight: size - 2
- radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
+ radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0
color: Colours.palette.m3primary
StyledRect {
@@ -72,13 +72,13 @@ StyledRect {
}
Behavior on leading {
- enabled: BarConfig.workspaces.activeTrail
+ enabled: Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on trailing {
- enabled: BarConfig.workspaces.activeTrail
+ enabled: Config.bar.workspaces.activeTrail
Anim {
duration: Appearance.anim.durations.normal * 2
@@ -86,19 +86,19 @@ StyledRect {
}
Behavior on currentSize {
- enabled: BarConfig.workspaces.activeTrail
+ enabled: Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on offset {
- enabled: !BarConfig.workspaces.activeTrail
+ enabled: !Config.bar.workspaces.activeTrail
Anim {}
}
Behavior on size {
- enabled: !BarConfig.workspaces.activeTrail
+ enabled: !Config.bar.workspaces.activeTrail
Anim {}
}
diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml
index 4fba2f4..c5ed7cc 100644
--- a/modules/bar/components/workspaces/OccupiedBg.qml
+++ b/modules/bar/components/workspaces/OccupiedBg.qml
@@ -18,7 +18,7 @@ Item {
onOccupiedChanged: {
let count = 0;
const start = groupOffset;
- const end = start + BarConfig.workspaces.shown;
+ const end = start + Config.bar.workspaces.shown;
for (const [ws, occ] of Object.entries(occupied)) {
if (ws > start && ws <= end && occ) {
if (!occupied[ws - 1]) {
@@ -52,11 +52,11 @@ Item {
readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null
color: Colours.alpha(Colours.palette.m3surfaceContainerHigh, true)
- radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
+ radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0
x: start?.x ?? 0
y: start?.y ?? 0
- implicitWidth: BarConfig.sizes.innerHeight
+ implicitWidth: Config.bar.sizes.innerHeight
implicitHeight: end?.y + end?.height - start?.y
anchors.horizontalCenter: parent.horizontalCenter
diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml
index fa5fe62..6cf5c40 100644
--- a/modules/bar/components/workspaces/Workspace.qml
+++ b/modules/bar/components/workspaces/Workspace.qml
@@ -19,7 +19,7 @@ Item {
readonly property int ws: groupOffset + index + 1
readonly property bool isOccupied: occupied[ws] ?? false
- readonly property bool hasWindows: isOccupied && BarConfig.workspaces.showWindows
+ readonly property bool hasWindows: isOccupied && Config.bar.workspaces.showWindows
Layout.preferredWidth: childrenRect.width
Layout.preferredHeight: size
@@ -27,24 +27,24 @@ Item {
StyledText {
id: indicator
- readonly property string label: BarConfig.workspaces.label || root.ws
- readonly property string occupiedLabel: BarConfig.workspaces.occupiedLabel || label
- readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
+ readonly property string label: Config.bar.workspaces.label || root.ws
+ readonly property string occupiedLabel: Config.bar.workspaces.occupiedLabel || label
+ readonly property string activeLabel: Config.bar.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
animate: true
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label
- color: BarConfig.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant
+ color: Config.bar.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant
horizontalAlignment: StyledText.AlignHCenter
verticalAlignment: StyledText.AlignVCenter
- width: BarConfig.sizes.innerHeight
- height: BarConfig.sizes.innerHeight
+ width: Config.bar.sizes.innerHeight
+ height: Config.bar.sizes.innerHeight
}
Loader {
id: windows
- active: BarConfig.workspaces.showWindows
+ active: Config.bar.workspaces.showWindows
asynchronous: true
anchors.horizontalCenter: indicator.horizontalCenter
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml
index 4f4c75b..9264762 100644
--- a/modules/bar/components/workspaces/Workspaces.qml
+++ b/modules/bar/components/workspaces/Workspaces.qml
@@ -14,7 +14,7 @@ Item {
acc[curr.id] = curr.lastIpcObject.windows > 0;
return acc;
}, {})
- readonly property int groupOffset: Math.floor((Hyprland.activeWsId - 1) / BarConfig.workspaces.shown) * BarConfig.workspaces.shown
+ readonly property int groupOffset: Math.floor((Hyprland.activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
@@ -27,7 +27,7 @@ Item {
layer.smooth: true
Repeater {
- model: BarConfig.workspaces.shown
+ model: Config.bar.workspaces.shown
Workspace {
occupied: root.occupied
@@ -37,7 +37,7 @@ Item {
}
Loader {
- active: BarConfig.workspaces.occupiedBg
+ active: Config.bar.workspaces.occupiedBg
asynchronous: true
z: -1
@@ -51,7 +51,7 @@ Item {
}
Loader {
- active: BarConfig.workspaces.activeIndicator
+ active: Config.bar.workspaces.activeIndicator
asynchronous: true
sourceComponent: ActiveIndicator {
diff --git a/modules/bar/popouts/ActiveWindow.qml b/modules/bar/popouts/ActiveWindow.qml
index f3a5269..03130f1 100644
--- a/modules/bar/popouts/ActiveWindow.qml
+++ b/modules/bar/popouts/ActiveWindow.qml
@@ -61,8 +61,8 @@ Item {
captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null
live: visible
- constraintSize.width: BarConfig.sizes.windowPreviewSize
- constraintSize.height: BarConfig.sizes.windowPreviewSize
+ constraintSize.width: Config.bar.sizes.windowPreviewSize
+ constraintSize.height: Config.bar.sizes.windowPreviewSize
}
}
}
diff --git a/modules/bar/popouts/Background.qml b/modules/bar/popouts/Background.qml
index a56b0b7..c099118 100644
--- a/modules/bar/popouts/Background.qml
+++ b/modules/bar/popouts/Background.qml
@@ -8,13 +8,13 @@ ShapePath {
required property Wrapper wrapper
required property bool invertBottomRounding
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
property real ibr: invertBottomRounding ? -1 : 1
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathArc {
relativeX: root.roundingX
diff --git a/modules/bar/popouts/Battery.qml b/modules/bar/popouts/Battery.qml
index 44e51ce..ebd0fc8 100644
--- a/modules/bar/popouts/Battery.qml
+++ b/modules/bar/popouts/Battery.qml
@@ -10,7 +10,7 @@ Column {
id: root
spacing: Appearance.spacing.normal
- width: BarConfig.sizes.batteryWidth
+ width: Config.bar.sizes.batteryWidth
StyledText {
text: UPower.displayDevice.isLaptopBattery ? qsTr("Remaining: %1%").arg(Math.round(UPower.displayDevice.percentage * 100)) : qsTr("No battery detected")
diff --git a/modules/bar/popouts/TrayMenu.qml b/modules/bar/popouts/TrayMenu.qml
index d69bf38..433de7f 100644
--- a/modules/bar/popouts/TrayMenu.qml
+++ b/modules/bar/popouts/TrayMenu.qml
@@ -80,7 +80,7 @@ StackView {
required property QsMenuEntry modelData
- implicitWidth: BarConfig.sizes.trayMenuWidth
+ implicitWidth: Config.bar.sizes.trayMenuWidth
implicitHeight: modelData.isSeparator ? 1 : children.implicitHeight
radius: Appearance.rounding.full
@@ -153,7 +153,7 @@ StackView {
font.family: label.font.family
elide: Text.ElideRight
- elideWidth: BarConfig.sizes.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + Appearance.spacing.normal : 0)
+ elideWidth: Config.bar.sizes.trayMenuWidth - (icon.active ? icon.implicitWidth + label.anchors.leftMargin : 0) - (expand.active ? expand.implicitWidth + Appearance.spacing.normal : 0)
}
Loader {
diff --git a/modules/dashboard/Background.qml b/modules/dashboard/Background.qml
index ebc60c8..876311e 100644
--- a/modules/dashboard/Background.qml
+++ b/modules/dashboard/Background.qml
@@ -7,12 +7,12 @@ ShapePath {
id: root
required property Wrapper wrapper
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathArc {
relativeX: root.rounding
diff --git a/modules/dashboard/Dash.qml b/modules/dashboard/Dash.qml
index eaf4344..22132af 100644
--- a/modules/dashboard/Dash.qml
+++ b/modules/dashboard/Dash.qml
@@ -26,7 +26,7 @@ GridLayout {
Rect {
Layout.row: 0
Layout.columnSpan: 2
- Layout.preferredWidth: DashboardConfig.sizes.weatherWidth
+ Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
Layout.fillHeight: true
Weather {}
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index 43ef597..2d004d5 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -28,8 +28,8 @@ Item {
return `${Math.floor(length / 60)}:${Math.floor(length % 60).toString().padStart(2, "0")}`;
}
- implicitWidth: cover.implicitWidth + DashboardConfig.sizes.mediaVisualiserSize * 2 + details.implicitWidth + details.anchors.leftMargin + bongocat.implicitWidth + bongocat.anchors.leftMargin * 2 + Appearance.padding.large * 2
- implicitHeight: Math.max(cover.implicitHeight + DashboardConfig.sizes.mediaVisualiserSize * 2, details.implicitHeight, bongocat.implicitHeight) + Appearance.padding.large * 2
+ implicitWidth: cover.implicitWidth + Config.dashboard.sizes.mediaVisualiserSize * 2 + details.implicitWidth + details.anchors.leftMargin + bongocat.implicitWidth + bongocat.anchors.leftMargin * 2 + Appearance.padding.large * 2
+ implicitHeight: Math.max(cover.implicitHeight + Config.dashboard.sizes.mediaVisualiserSize * 2, details.implicitHeight, bongocat.implicitHeight) + Appearance.padding.large * 2
Behavior on playerProgress {
NumberAnimation {
@@ -41,7 +41,7 @@ Item {
Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
- interval: DashboardConfig.mediaUpdateInterval
+ interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: Players.active?.positionChanged()
@@ -66,7 +66,7 @@ Item {
property color colour: Colours.palette.m3primary
anchors.fill: cover
- anchors.margins: -DashboardConfig.sizes.mediaVisualiserSize
+ anchors.margins: -Config.dashboard.sizes.mediaVisualiserSize
onColourChanged: requestPaint()
@@ -81,7 +81,7 @@ Item {
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round";
- const size = DashboardConfig.sizes.mediaVisualiserSize;
+ const size = Config.dashboard.sizes.mediaVisualiserSize;
const cx = centerX;
const cy = centerY;
const rx = innerX + ctx.lineWidth / 2;
@@ -116,10 +116,10 @@ Item {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
- anchors.leftMargin: Appearance.padding.large + DashboardConfig.sizes.mediaVisualiserSize
+ anchors.leftMargin: Appearance.padding.large + Config.dashboard.sizes.mediaVisualiserSize
- implicitWidth: DashboardConfig.sizes.mediaCoverArtSize
- implicitHeight: DashboardConfig.sizes.mediaCoverArtSize
+ implicitWidth: Config.dashboard.sizes.mediaCoverArtSize
+ implicitHeight: Config.dashboard.sizes.mediaCoverArtSize
color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full
diff --git a/modules/dashboard/Performance.qml b/modules/dashboard/Performance.qml
index 8513d19..b7bf8d0 100644
--- a/modules/dashboard/Performance.qml
+++ b/modules/dashboard/Performance.qml
@@ -65,7 +65,7 @@ Row {
property bool primary
readonly property real primaryMult: primary ? 1.2 : 1
- readonly property real thickness: DashboardConfig.sizes.resourceProgessThickness * primaryMult
+ readonly property real thickness: Config.dashboard.sizes.resourceProgessThickness * primaryMult
property color fg1: Colours.palette.m3primary
property color fg2: Colours.palette.m3secondary
@@ -74,8 +74,8 @@ Row {
anchors.verticalCenter: parent.verticalCenter
- implicitWidth: DashboardConfig.sizes.resourceSize * primaryMult
- implicitHeight: DashboardConfig.sizes.resourceSize * primaryMult
+ implicitWidth: Config.dashboard.sizes.resourceSize * primaryMult
+ implicitHeight: Config.dashboard.sizes.resourceSize * primaryMult
onValue1Changed: canvas.requestPaint()
onValue2Changed: canvas.requestPaint()
diff --git a/modules/dashboard/Tabs.qml b/modules/dashboard/Tabs.qml
index 46cbd76..e678e6a 100644
--- a/modules/dashboard/Tabs.qml
+++ b/modules/dashboard/Tabs.qml
@@ -48,14 +48,14 @@ Item {
id: indicator
anchors.top: bar.bottom
- anchors.topMargin: DashboardConfig.sizes.tabIndicatorSpacing
+ anchors.topMargin: Config.dashboard.sizes.tabIndicatorSpacing
implicitWidth: bar.currentItem.implicitWidth
- implicitHeight: DashboardConfig.sizes.tabIndicatorHeight
+ implicitHeight: Config.dashboard.sizes.tabIndicatorHeight
x: {
const tab = bar.currentItem;
- const width = (root.nonAnimWidth - DashboardConfig.sizes.tabIndicatorSpacing * (bar.count - 1) * 2) / bar.count
+ const width = (root.nonAnimWidth - Config.dashboard.sizes.tabIndicatorSpacing * (bar.count - 1) * 2) / bar.count;
return width * tab.TabBar.index + (width - tab.implicitWidth) / 2;
}
@@ -69,7 +69,6 @@ Item {
color: Colours.palette.m3primary
radius: Appearance.rounding.full
-
}
Behavior on x {
@@ -108,14 +107,17 @@ Item {
cursorShape: Qt.PointingHandCursor
- onPressed: ({x,y}) => {
+ onPressed: ({
+ x,
+ y
+ }) => {
tab.TabBar.tabBar.setCurrentIndex(tab.TabBar.index);
const stateY = stateWrapper.y;
rippleAnim.x = x;
rippleAnim.y = y - stateY;
- const dist = (ox,oy) => ox * ox + oy * oy;
+ const dist = (ox, oy) => ox * ox + oy * oy;
const stateEndY = stateY + stateWrapper.height;
rippleAnim.radius = Math.sqrt(Math.max(dist(0, stateY), dist(0, stateEndY), dist(width, stateY), dist(width, stateEndY)));
@@ -176,7 +178,7 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
- implicitHeight: parent.height + DashboardConfig.sizes.tabIndicatorSpacing * 2
+ implicitHeight: parent.height + Config.dashboard.sizes.tabIndicatorSpacing * 2
color: "transparent"
radius: Appearance.rounding.small
@@ -237,7 +239,6 @@ Item {
text: tab.text
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
}
-
}
}
diff --git a/modules/dashboard/dash/DateTime.qml b/modules/dashboard/dash/DateTime.qml
index 738fed1..25df7a5 100644
--- a/modules/dashboard/dash/DateTime.qml
+++ b/modules/dashboard/dash/DateTime.qml
@@ -8,7 +8,7 @@ Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
- implicitWidth: DashboardConfig.sizes.dateTimeWidth
+ implicitWidth: Config.dashboard.sizes.dateTimeWidth
StyledText {
id: hours
diff --git a/modules/dashboard/dash/Media.qml b/modules/dashboard/dash/Media.qml
index 7122d69..f47079d 100644
--- a/modules/dashboard/dash/Media.qml
+++ b/modules/dashboard/dash/Media.qml
@@ -19,7 +19,7 @@ Item {
anchors.top: parent.top
anchors.bottom: parent.bottom
- implicitWidth: DashboardConfig.sizes.mediaWidth
+ implicitWidth: Config.dashboard.sizes.mediaWidth
Behavior on playerProgress {
NumberAnimation {
@@ -31,7 +31,7 @@ Item {
Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
- interval: DashboardConfig.mediaUpdateInterval
+ interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true
repeat: true
onTriggered: Players.active?.positionChanged()
@@ -43,16 +43,16 @@ Item {
ShapePath {
fillColor: "transparent"
strokeColor: Colours.palette.m3surfaceContainerHigh
- strokeWidth: DashboardConfig.sizes.mediaProgressThickness
+ strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
- radiusX: (cover.width + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
- radiusY: (cover.height + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
- startAngle: -90 - DashboardConfig.sizes.mediaProgressSweep / 2
- sweepAngle: DashboardConfig.sizes.mediaProgressSweep
+ radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
+ radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
+ startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
+ sweepAngle: Config.dashboard.sizes.mediaProgressSweep
}
Behavior on strokeColor {
@@ -67,16 +67,16 @@ Item {
ShapePath {
fillColor: "transparent"
strokeColor: Colours.palette.m3primary
- strokeWidth: DashboardConfig.sizes.mediaProgressThickness
+ strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap
PathAngleArc {
centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2
- radiusX: (cover.width + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
- radiusY: (cover.height + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
- startAngle: -90 - DashboardConfig.sizes.mediaProgressSweep / 2
- sweepAngle: DashboardConfig.sizes.mediaProgressSweep * root.playerProgress
+ radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
+ radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
+ startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
+ sweepAngle: Config.dashboard.sizes.mediaProgressSweep * root.playerProgress
}
Behavior on strokeColor {
@@ -95,7 +95,7 @@ Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
- anchors.margins: Appearance.padding.large + DashboardConfig.sizes.mediaProgressThickness + Appearance.spacing.small
+ anchors.margins: Appearance.padding.large + Config.dashboard.sizes.mediaProgressThickness + Appearance.spacing.small
implicitHeight: width
color: Colours.palette.m3surfaceContainerHigh
diff --git a/modules/dashboard/dash/Resources.qml b/modules/dashboard/dash/Resources.qml
index b22b2d1..9a1f07a 100644
--- a/modules/dashboard/dash/Resources.qml
+++ b/modules/dashboard/dash/Resources.qml
@@ -49,7 +49,7 @@ Row {
anchors.bottom: icon.top
anchors.bottomMargin: Appearance.spacing.small
- implicitWidth: DashboardConfig.sizes.resourceProgessThickness
+ implicitWidth: Config.dashboard.sizes.resourceProgessThickness
color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full
diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml
index d2dc4e7..f36c03d 100644
--- a/modules/dashboard/dash/User.qml
+++ b/modules/dashboard/dash/User.qml
@@ -90,7 +90,7 @@ Row {
id: icon
anchors.left: parent.left
- anchors.leftMargin: (DashboardConfig.sizes.infoIconSize - implicitWidth) / 2
+ anchors.leftMargin: (Config.dashboard.sizes.infoIconSize - implicitWidth) / 2
text: line.icon
color: line.colour
@@ -109,7 +109,7 @@ Row {
text: `: ${line.text}`
font.pointSize: Appearance.font.size.normal
- width: DashboardConfig.sizes.infoWidth
+ width: Config.dashboard.sizes.infoWidth
elide: Text.ElideRight
}
}
diff --git a/modules/drawers/Backgrounds.qml b/modules/drawers/Backgrounds.qml
index 1840da1..46ca477 100644
--- a/modules/drawers/Backgrounds.qml
+++ b/modules/drawers/Backgrounds.qml
@@ -16,7 +16,7 @@ Shape {
required property Item bar
anchors.fill: parent
- anchors.margins: BorderConfig.thickness
+ anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth
preferredRendererType: Shape.CurveRenderer
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1
diff --git a/modules/drawers/Border.qml b/modules/drawers/Border.qml
index 9014d07..62dc277 100644
--- a/modules/drawers/Border.qml
+++ b/modules/drawers/Border.qml
@@ -16,7 +16,7 @@ Item {
id: rect
anchors.fill: parent
- color: Colours.alpha(BorderConfig.colour, false)
+ color: Colours.alpha(Config.border.colour, false)
visible: false
}
@@ -29,9 +29,9 @@ Item {
Rectangle {
anchors.fill: parent
- anchors.margins: BorderConfig.thickness
+ anchors.margins: Config.border.thickness
anchors.leftMargin: root.bar.implicitWidth
- radius: BorderConfig.rounding
+ radius: Config.border.rounding
}
}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 9930c6d..5cab75b 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -33,9 +33,9 @@ Variants {
mask: Region {
x: bar.implicitWidth
- y: BorderConfig.thickness
- width: win.width - bar.implicitWidth - BorderConfig.thickness
- height: win.height - BorderConfig.thickness * 2
+ y: Config.border.thickness
+ width: win.width - bar.implicitWidth - Config.border.thickness
+ height: win.height - Config.border.thickness * 2
intersection: Intersection.Xor
regions: regions.instances
@@ -55,7 +55,7 @@ Variants {
required property Item modelData
x: modelData.x + bar.implicitWidth
- y: modelData.y + BorderConfig.thickness
+ y: modelData.y + Config.border.thickness
width: modelData.width
height: modelData.height
intersection: Intersection.Subtract
diff --git a/modules/drawers/Exclusions.qml b/modules/drawers/Exclusions.qml
index 188aadb..d1e80dc 100644
--- a/modules/drawers/Exclusions.qml
+++ b/modules/drawers/Exclusions.qml
@@ -31,6 +31,6 @@ Scope {
component ExclusionZone: StyledWindow {
screen: root.screen
name: "border-exclusion"
- exclusiveZone: BorderConfig.thickness
+ exclusiveZone: Config.border.thickness
}
}
diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml
index 10e37a8..d38cc8a 100644
--- a/modules/drawers/Interactions.qml
+++ b/modules/drawers/Interactions.qml
@@ -20,8 +20,8 @@ MouseArea {
property bool osdShortcutActive
function withinPanelHeight(panel: Item, x: real, y: real): bool {
- const panelY = BorderConfig.thickness + panel.y;
- return y >= panelY - BorderConfig.rounding && y <= panelY + panel.height + BorderConfig.rounding;
+ const panelY = Config.border.thickness + panel.y;
+ return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
}
function inRightPanel(panel: Item, x: real, y: real): bool {
@@ -30,7 +30,7 @@ MouseArea {
function inTopPanel(panel: Item, x: real, y: real): bool {
const panelX = bar.implicitWidth + panel.x;
- return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX - BorderConfig.rounding && x <= panelX + panel.width + BorderConfig.rounding;
+ return y < Config.border.thickness + panel.y + panel.height && x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding;
}
anchors.fill: parent
@@ -51,7 +51,10 @@ MouseArea {
}
}
- onPositionChanged: ({x, y}) => {
+ onPositionChanged: ({
+ x,
+ y
+ }) => {
// Show osd on hover
const showOsd = inRightPanel(panels.osd, x, y);
@@ -68,9 +71,9 @@ MouseArea {
// Show/hide session on drag
if (pressed && withinPanelHeight(panels.session, x, y)) {
const dragX = x - dragStart.x;
- if (dragX < -SessionConfig.dragThreshold)
+ if (dragX < -Config.session.dragThreshold)
visibilities.session = true;
- else if (dragX > SessionConfig.dragThreshold)
+ else if (dragX > Config.session.dragThreshold)
visibilities.session = false;
}
diff --git a/modules/drawers/Panels.qml b/modules/drawers/Panels.qml
index 6c6d892..a422fcc 100644
--- a/modules/drawers/Panels.qml
+++ b/modules/drawers/Panels.qml
@@ -24,7 +24,7 @@ Item {
readonly property BarPopouts.Wrapper popouts: popouts
anchors.fill: parent
- anchors.margins: BorderConfig.thickness
+ anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth
Component.onCompleted: Visibilities.panels[screen] = this
@@ -83,7 +83,7 @@ Item {
anchors.left: parent.left
anchors.verticalCenter: parent.top
anchors.verticalCenterOffset: {
- const off = root.popouts.currentCenter - BorderConfig.thickness;
+ const off = root.popouts.currentCenter - Config.border.thickness;
const diff = root.height - Math.floor(off + implicitHeight / 2);
if (diff < 0)
return off + diff;
diff --git a/modules/launcher/ActionItem.qml b/modules/launcher/ActionItem.qml
index a650768..db3242a 100644
--- a/modules/launcher/ActionItem.qml
+++ b/modules/launcher/ActionItem.qml
@@ -9,7 +9,7 @@ Item {
required property Actions.Action modelData
required property var list
- implicitHeight: LauncherConfig.sizes.itemHeight
+ implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left
anchors.right: parent?.right
diff --git a/modules/launcher/Actions.qml b/modules/launcher/Actions.qml
index 0cbc870..beb77a5 100644
--- a/modules/launcher/Actions.qml
+++ b/modules/launcher/Actions.qml
@@ -96,7 +96,7 @@ Singleton {
}))
function fuzzyQuery(search: string): var {
- return Fuzzy.go(search.slice(LauncherConfig.actionPrefix.length), preppedActions, {
+ return Fuzzy.go(search.slice(Config.launcher.actionPrefix.length), preppedActions, {
all: true,
keys: ["name", "desc"],
scoreFn: r => r[0].score > 0 ? r[0].score * 0.9 + r[1].score * 0.1 : 0
@@ -104,7 +104,7 @@ Singleton {
}
function autocomplete(list: AppList, text: string): void {
- list.search.text = `${LauncherConfig.actionPrefix}${text} `;
+ list.search.text = `${Config.launcher.actionPrefix}${text} `;
}
Process {
diff --git a/modules/launcher/AppItem.qml b/modules/launcher/AppItem.qml
index b6a0bf5..e3f6720 100644
--- a/modules/launcher/AppItem.qml
+++ b/modules/launcher/AppItem.qml
@@ -11,7 +11,7 @@ Item {
required property DesktopEntry modelData
required property PersistentProperties visibilities
- implicitHeight: LauncherConfig.sizes.itemHeight
+ implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left
anchors.right: parent?.right
diff --git a/modules/launcher/AppList.qml b/modules/launcher/AppList.qml
index a431395..b2b9f57 100644
--- a/modules/launcher/AppList.qml
+++ b/modules/launcher/AppList.qml
@@ -14,14 +14,14 @@ ListView {
required property TextField search
required property PersistentProperties visibilities
- property bool isAction: search.text.startsWith(LauncherConfig.actionPrefix)
+ property bool isAction: search.text.startsWith(Config.launcher.actionPrefix)
function getModelValues() {
let text = search.text;
if (isAction)
return Actions.fuzzyQuery(text);
- if (text.startsWith(LauncherConfig.actionPrefix))
- text = search.text.slice(LauncherConfig.actionPrefix.length);
+ if (text.startsWith(Config.launcher.actionPrefix))
+ text = search.text.slice(Config.launcher.actionPrefix.length);
return Apps.fuzzyQuery(text);
}
@@ -32,7 +32,7 @@ ListView {
spacing: Appearance.spacing.small
orientation: Qt.Vertical
- implicitHeight: (LauncherConfig.sizes.itemHeight + spacing) * Math.min(LauncherConfig.maxShown, count) - spacing
+ implicitHeight: (Config.launcher.sizes.itemHeight + spacing) * Math.min(Config.launcher.maxShown, count) - spacing
highlightMoveDuration: Appearance.anim.durations.normal
highlightResizeDuration: 0
diff --git a/modules/launcher/Background.qml b/modules/launcher/Background.qml
index 5a3d5d4..82c5f4a 100644
--- a/modules/launcher/Background.qml
+++ b/modules/launcher/Background.qml
@@ -7,12 +7,12 @@ ShapePath {
id: root
required property Wrapper wrapper
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathArc {
relativeX: root.rounding
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index 54cc872..b6d1056 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -74,7 +74,7 @@ Item {
topPadding: Appearance.padding.larger
bottomPadding: Appearance.padding.larger
- placeholderText: qsTr("Type \"%1\" for commands").arg(LauncherConfig.actionPrefix)
+ placeholderText: qsTr("Type \"%1\" for commands").arg(Config.launcher.actionPrefix)
background: null
onAccepted: {
@@ -83,7 +83,7 @@ Item {
if (list.showWallpapers) {
Wallpapers.setWallpaper(currentItem.modelData.path);
root.visibilities.launcher = false;
- } else if (text.startsWith(LauncherConfig.actionPrefix)) {
+ } else if (text.startsWith(Config.launcher.actionPrefix)) {
currentItem.modelData.onClicked(list.currentList);
} else {
Apps.launch(currentItem.modelData);
diff --git a/modules/launcher/ContentList.qml b/modules/launcher/ContentList.qml
index 9818118..ad116f7 100644
--- a/modules/launcher/ContentList.qml
+++ b/modules/launcher/ContentList.qml
@@ -15,7 +15,7 @@ Item {
required property int padding
required property int rounding
- property bool showWallpapers: search.text.startsWith(`${LauncherConfig.actionPrefix}wallpaper `)
+ property bool showWallpapers: search.text.startsWith(`${Config.launcher.actionPrefix}wallpaper `)
property var currentList: (showWallpapers ? wallpaperList : appList).item
anchors.horizontalCenter: parent.horizontalCenter
@@ -29,7 +29,7 @@ Item {
name: "apps"
PropertyChanges {
- root.implicitWidth: LauncherConfig.sizes.itemWidth
+ root.implicitWidth: Config.launcher.sizes.itemWidth
root.implicitHeight: Math.max(empty.height, appList.height)
appList.active: true
}
@@ -43,8 +43,8 @@ Item {
name: "wallpapers"
PropertyChanges {
- root.implicitWidth: Math.max(LauncherConfig.sizes.itemWidth, wallpaperList.width)
- root.implicitHeight: LauncherConfig.sizes.wallpaperHeight
+ root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth, wallpaperList.width)
+ root.implicitHeight: Config.launcher.sizes.wallpaperHeight
wallpaperList.active: true
}
}
diff --git a/modules/launcher/WallpaperItem.qml b/modules/launcher/WallpaperItem.qml
index dbd482e..862e910 100644
--- a/modules/launcher/WallpaperItem.qml
+++ b/modules/launcher/WallpaperItem.qml
@@ -42,7 +42,7 @@ StyledRect {
path: root.modelData.path
smooth: !root.PathView.view.moving
- width: LauncherConfig.sizes.wallpaperWidth
+ width: Config.launcher.sizes.wallpaperWidth
height: width / 16 * 9
}
diff --git a/modules/launcher/WallpaperList.qml b/modules/launcher/WallpaperList.qml
index fef1726..fd82a2b 100644
--- a/modules/launcher/WallpaperList.qml
+++ b/modules/launcher/WallpaperList.qml
@@ -14,8 +14,8 @@ PathView {
const screenWidth = QsWindow.window?.screen.width * 0.8;
if (!screenWidth)
return 0;
- const itemWidth = LauncherConfig.sizes.wallpaperWidth * 0.8;
- const max = LauncherConfig.maxWallpapers;
+ const itemWidth = Config.launcher.sizes.wallpaperWidth * 0.8;
+ const max = Config.launcher.maxWallpapers;
if (max * itemWidth > screenWidth) {
const items = Math.floor(screenWidth / itemWidth);
return items > 1 && items % 2 === 0 ? items - 1 : items;
@@ -43,7 +43,7 @@ PathView {
Wallpapers.preview(currentItem.modelData.path);
}
- implicitWidth: Math.min(numItems, count) * (LauncherConfig.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2)
+ implicitWidth: Math.min(numItems, count) * (Config.launcher.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2)
pathItemCount: numItems
cacheItemCount: 4
diff --git a/modules/notifications/Background.qml b/modules/notifications/Background.qml
index 2fd05f8..4a38510 100644
--- a/modules/notifications/Background.qml
+++ b/modules/notifications/Background.qml
@@ -8,13 +8,13 @@ ShapePath {
id: root
required property Wrapper wrapper
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
- property real fullHeightRounding: wrapper.height >= QsWindow.window?.height - BorderConfig.thickness * 2 ? -rounding : rounding
+ property real fullHeightRounding: wrapper.height >= QsWindow.window?.height - Config.border.thickness * 2 ? -rounding : rounding
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathLine {
relativeX: -(root.wrapper.width + root.rounding)
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml
index a64ccb9..6983b95 100644
--- a/modules/notifications/Content.qml
+++ b/modules/notifications/Content.qml
@@ -14,7 +14,7 @@ Item {
anchors.bottom: parent.bottom
anchors.right: parent.right
- implicitWidth: NotifsConfig.sizes.width + padding * 2
+ implicitWidth: Config.notifs.sizes.width + padding * 2
implicitHeight: {
const count = list.count;
if (count === 0)
@@ -29,19 +29,19 @@ Item {
const panel = Visibilities.panels[screen];
if (visibilities && panel) {
if (visibilities.osd) {
- const h = panel.osd.y - BorderConfig.rounding * 2;
+ const h = panel.osd.y - Config.border.rounding * 2;
if (height > h)
height = h;
}
if (visibilities.session) {
- const h = panel.session.y - BorderConfig.rounding * 2;
+ const h = panel.session.y - Config.border.rounding * 2;
if (height > h)
height = h;
}
}
- return Math.min((screen?.height ?? 0) - BorderConfig.thickness * 2, height + padding * 2);
+ return Math.min((screen?.height ?? 0) - Config.border.thickness * 2, height + padding * 2);
}
ClippingWrapperRectangle {
@@ -108,7 +108,7 @@ Item {
Anim {
target: notif
property: "x"
- to: (notif.x >= 0 ? NotifsConfig.sizes.width : -NotifsConfig.sizes.width) * 2
+ to: (notif.x >= 0 ? Config.notifs.sizes.width : -Config.notifs.sizes.width) * 2
duration: Appearance.anim.durations.normal
easing.bezierCurve: Appearance.anim.curves.emphasized
}
diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml
index 848eac4..ebc5ce6 100644
--- a/modules/notifications/Notification.qml
+++ b/modules/notifications/Notification.qml
@@ -20,10 +20,10 @@ StyledRect {
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
radius: Appearance.rounding.normal
- implicitWidth: NotifsConfig.sizes.width
+ implicitWidth: Config.notifs.sizes.width
implicitHeight: inner.implicitHeight
- x: NotifsConfig.sizes.width
+ x: Config.notifs.sizes.width
Component.onCompleted: x = 0
RetainableLock {
@@ -52,7 +52,7 @@ StyledRect {
root.modelData.notification.dismiss();
}
onReleased: event => {
- if (Math.abs(root.x) < NotifsConfig.sizes.width * NotifsConfig.clearThreshold)
+ if (Math.abs(root.x) < Config.notifs.sizes.width * Config.notifs.clearThreshold)
root.x = 0;
else
root.modelData.popup = false;
@@ -60,12 +60,12 @@ StyledRect {
onPositionChanged: event => {
if (pressed) {
const diffY = event.y - startY;
- if (Math.abs(diffY) > NotifsConfig.expandThreshold)
+ if (Math.abs(diffY) > Config.notifs.expandThreshold)
root.expanded = diffY > 0;
}
}
onClicked: event => {
- if (!NotifsConfig.actionOnClick || event.button !== Qt.LeftButton)
+ if (!Config.notifs.actionOnClick || event.button !== Qt.LeftButton)
return;
const actions = root.modelData.actions;
@@ -107,14 +107,14 @@ StyledRect {
anchors.left: parent.left
anchors.top: parent.top
- width: NotifsConfig.sizes.image
- height: NotifsConfig.sizes.image
+ width: Config.notifs.sizes.image
+ height: Config.notifs.sizes.image
visible: root.hasImage || root.hasAppIcon
sourceComponent: ClippingRectangle {
radius: Appearance.rounding.full
- implicitWidth: NotifsConfig.sizes.image
- implicitHeight: NotifsConfig.sizes.image
+ implicitWidth: Config.notifs.sizes.image
+ implicitHeight: Config.notifs.sizes.image
Image {
anchors.fill: parent
@@ -140,8 +140,8 @@ StyledRect {
sourceComponent: StyledRect {
radius: Appearance.rounding.full
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer
- implicitWidth: root.hasImage ? NotifsConfig.sizes.badge : NotifsConfig.sizes.image
- implicitHeight: root.hasImage ? NotifsConfig.sizes.badge : NotifsConfig.sizes.image
+ implicitWidth: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image
+ implicitHeight: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image
Loader {
id: icon
diff --git a/modules/osd/Background.qml b/modules/osd/Background.qml
index 551637b..12cce6a 100644
--- a/modules/osd/Background.qml
+++ b/modules/osd/Background.qml
@@ -7,12 +7,12 @@ ShapePath {
id: root
required property Wrapper wrapper
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathArc {
relativeX: -root.roundingX
diff --git a/modules/osd/Content.qml b/modules/osd/Content.qml
index 6814966..4bd43af 100644
--- a/modules/osd/Content.qml
+++ b/modules/osd/Content.qml
@@ -28,8 +28,8 @@ Column {
value: Audio.volume
onMoved: Audio.setVolume(value)
- implicitWidth: OsdConfig.sizes.sliderWidth
- implicitHeight: OsdConfig.sizes.sliderHeight
+ implicitWidth: Config.osd.sizes.sliderWidth
+ implicitHeight: Config.osd.sizes.sliderHeight
}
VerticalSlider {
@@ -37,7 +37,7 @@ Column {
value: root.monitor?.brightness ?? 0
onMoved: root.monitor?.setBrightness(value)
- implicitWidth: OsdConfig.sizes.sliderWidth
- implicitHeight: OsdConfig.sizes.sliderHeight
+ implicitWidth: Config.osd.sizes.sliderWidth
+ implicitHeight: Config.osd.sizes.sliderHeight
}
}
diff --git a/modules/osd/Interactions.qml b/modules/osd/Interactions.qml
index eecf0b6..fa75aa0 100644
--- a/modules/osd/Interactions.qml
+++ b/modules/osd/Interactions.qml
@@ -39,7 +39,7 @@ Scope {
Timer {
id: timer
- interval: OsdConfig.hideDelay
+ interval: Config.osd.hideDelay
onTriggered: {
if (!root.hovered)
root.visibilities.osd = false;
diff --git a/modules/session/Background.qml b/modules/session/Background.qml
index 551637b..12cce6a 100644
--- a/modules/session/Background.qml
+++ b/modules/session/Background.qml
@@ -7,12 +7,12 @@ ShapePath {
id: root
required property Wrapper wrapper
- readonly property real rounding: BorderConfig.rounding
+ readonly property real rounding: Config.border.rounding
readonly property bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
strokeWidth: -1
- fillColor: BorderConfig.colour
+ fillColor: Config.border.colour
PathArc {
relativeX: -root.roundingX
diff --git a/modules/session/Content.qml b/modules/session/Content.qml
index 7c69bbd..f6b1258 100644
--- a/modules/session/Content.qml
+++ b/modules/session/Content.qml
@@ -48,8 +48,8 @@ Column {
}
AnimatedImage {
- width: SessionConfig.sizes.button
- height: SessionConfig.sizes.button
+ width: Config.session.sizes.button
+ height: Config.session.sizes.button
sourceSize.width: width
sourceSize.height: height
@@ -84,8 +84,8 @@ Column {
required property string icon
required property list<string> command
- implicitWidth: SessionConfig.sizes.button
- implicitHeight: SessionConfig.sizes.button
+ implicitWidth: Config.session.sizes.button
+ implicitHeight: Config.session.sizes.button
radius: Appearance.rounding.large
color: button.activeFocus ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
diff --git a/services/Cava.qml b/services/Cava.qml
index eaa6e20..3fa5083 100644
--- a/services/Cava.qml
+++ b/services/Cava.qml
@@ -11,7 +11,7 @@ Singleton {
Process {
running: true
- command: ["sh", "-c", `printf '[general]\nframerate=60\nbars=${DashboardConfig.visualiserBars}\n[output]\nchannels=mono\nmethod=raw\nraw_target=/dev/stdout\ndata_format=ascii\nascii_max_range=100' | cava -p /dev/stdin`]
+ command: ["sh", "-c", `printf '[general]\nframerate=60\nbars=${Config.dashboard.visualiserBars}\n[output]\nchannels=mono\nmethod=raw\nraw_target=/dev/stdout\ndata_format=ascii\nascii_max_range=100' | cava -p /dev/stdin`]
stdout: SplitParser {
onRead: data => root.values = data.slice(0, -1).split(";").map(v => parseInt(v, 10))
}
diff --git a/services/Notifs.qml b/services/Notifs.qml
index 4acd56f..73d98a2 100644
--- a/services/Notifs.qml
+++ b/services/Notifs.qml
@@ -80,9 +80,9 @@ Singleton {
readonly property Timer timer: Timer {
running: true
- interval: notif.notification.expireTimeout > 0 ? notif.notification.expireTimeout : NotifsConfig.defaultExpireTimeout
+ interval: notif.notification.expireTimeout > 0 ? notif.notification.expireTimeout : Config.notifs.defaultExpireTimeout
onTriggered: {
- if (NotifsConfig.expire)
+ if (Config.notifs.expire)
notif.popup = false;
}
}
diff --git a/utils/Paths.qml b/utils/Paths.qml
index 88267ea..bd57608 100644
--- a/utils/Paths.qml
+++ b/utils/Paths.qml
@@ -13,6 +13,7 @@ Singleton {
readonly property url data: `${StandardPaths.standardLocations(StandardPaths.GenericDataLocation)[0]}/caelestia`
readonly property url state: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/caelestia`
readonly property url cache: `${StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]}/caelestia`
+ readonly property url config: `${StandardPaths.standardLocations(StandardPaths.GenericConfigLocation)[0]}/caelestia`
readonly property url imagecache: `${cache}/imagecache`