feat: user config file

Config file at `~/.config/caelestia/shell.json`
This commit is contained in:
2 * r + 2 * t 2025-06-15 18:08:45 +10:00
parent 3df0f7fd26
commit 96429160c3
52 changed files with 231 additions and 222 deletions

View file

@ -1,22 +1,14 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property JsonObject sizes: JsonObject {
Singleton {
id: root
readonly property Sizes sizes: Sizes {}
readonly property Workspaces workspaces: Workspaces {}
component Sizes: QtObject {
property int innerHeight: 30 property int innerHeight: 30
property int windowPreviewSize: 400 property int windowPreviewSize: 400
property int trayMenuWidth: 300 property int trayMenuWidth: 300
property int batteryWidth: 250 property int batteryWidth: 250
} }
component Workspaces: QtObject { property JsonObject workspaces: JsonObject {
property int shown: 5 property int shown: 5
property bool rounded: true property bool rounded: true
property bool activeIndicator: true property bool activeIndicator: true

View file

@ -1,13 +1,9 @@
pragma Singleton
import "root:/services" import "root:/services"
import Quickshell import Quickshell.Io
import QtQuick import QtQuick
Singleton { JsonObject {
id: root property color colour: Colours.palette.m3surface
property int thickness: Appearance.padding.normal
readonly property color colour: Colours.palette.m3surface property int rounding: Appearance.rounding.large
readonly property int thickness: Appearance.padding.normal
readonly property int rounding: Appearance.rounding.large
} }

36
config/Config.qml Normal file
View file

@ -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 {}
}
}
}

View file

@ -1,14 +1,10 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property int mediaUpdateInterval: 500
property int visualiserBars: 45
Singleton { property JsonObject sizes: JsonObject {
readonly property int mediaUpdateInterval: 500
readonly property int visualiserBars: 45
readonly property Sizes sizes: Sizes {}
component Sizes: QtObject {
readonly property int tabIndicatorHeight: 3 readonly property int tabIndicatorHeight: 3
readonly property int tabIndicatorSpacing: 5 readonly property int tabIndicatorSpacing: 5
readonly property int infoWidth: 200 readonly property int infoWidth: 200

View file

@ -1,18 +1,14 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property int maxShown: 8
property int maxWallpapers: 9 // Warning: even numbers look bad
property string actionPrefix: ">"
Singleton { property JsonObject sizes: JsonObject {
readonly property int maxShown: 8 property int itemWidth: 600
readonly property int maxWallpapers: 9 // Warning: even numbers look bad property int itemHeight: 57
readonly property string actionPrefix: ">" property int wallpaperWidth: 280
readonly property Sizes sizes: Sizes {} property int wallpaperHeight: 200
component Sizes: QtObject {
readonly property int itemWidth: 600
readonly property int itemHeight: 57
readonly property int wallpaperWidth: 280
readonly property int wallpaperHeight: 200
} }
} }

View file

@ -1,19 +1,15 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property bool expire: false
property int defaultExpireTimeout: 3000
property real clearThreshold: 0.3
property int expandThreshold: 20
property bool actionOnClick: false
Singleton { property JsonObject sizes: JsonObject {
readonly property bool expire: false property int width: 400
readonly property int defaultExpireTimeout: 3000 property int image: 41
readonly property real clearThreshold: 0.3 property int badge: 20
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
} }
} }

View file

@ -1,14 +1,10 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property int hideDelay: 2000
Singleton { property JsonObject sizes: JsonObject {
readonly property int hideDelay: 2000 property int sliderWidth: 30
readonly property Sizes sizes: Sizes {} property int sliderHeight: 150
component Sizes: QtObject {
readonly property int sliderWidth: 30
readonly property int sliderHeight: 150
} }
} }

View file

@ -1,13 +1,9 @@
pragma Singleton import Quickshell.Io
import Quickshell JsonObject {
import QtQuick property int dragThreshold: 30
Singleton { property JsonObject sizes: JsonObject {
readonly property int dragThreshold: 30 property int button: 80
readonly property Sizes sizes: Sizes {}
component Sizes: QtObject {
readonly property int button: 80
} }
} }

View file

@ -63,7 +63,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.left: parent.left anchors.left: parent.left
implicitWidth: child.implicitWidth + BorderConfig.thickness * 2 implicitWidth: child.implicitWidth + Config.border.thickness * 2
Item { Item {
id: child id: child
@ -97,8 +97,8 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: -BorderConfig.thickness anchors.leftMargin: -Config.border.thickness
anchors.rightMargin: -BorderConfig.thickness anchors.rightMargin: -Config.border.thickness
onWheel: event => { onWheel: event => {
const activeWs = Hyprland.activeClient?.workspace?.name; const activeWs = Hyprland.activeClient?.workspace?.name;

View file

@ -20,7 +20,7 @@ StyledRect {
property real offset: Math.min(leading, trailing) property real offset: Math.min(leading, trailing)
property real size: { property real size: {
const s = Math.abs(leading - trailing) + currentSize; 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 Math.min(getWsY(lastWs) + (workspaces[lastWs]?.size ?? 0) - offset, s);
return s; return s;
} }
@ -43,9 +43,9 @@ StyledRect {
clip: true clip: true
x: 1 x: 1
y: offset + 1 y: offset + 1
implicitWidth: BarConfig.sizes.innerHeight - 2 implicitWidth: Config.bar.sizes.innerHeight - 2
implicitHeight: size - 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 color: Colours.palette.m3primary
StyledRect { StyledRect {
@ -72,13 +72,13 @@ StyledRect {
} }
Behavior on leading { Behavior on leading {
enabled: BarConfig.workspaces.activeTrail enabled: Config.bar.workspaces.activeTrail
Anim {} Anim {}
} }
Behavior on trailing { Behavior on trailing {
enabled: BarConfig.workspaces.activeTrail enabled: Config.bar.workspaces.activeTrail
Anim { Anim {
duration: Appearance.anim.durations.normal * 2 duration: Appearance.anim.durations.normal * 2
@ -86,19 +86,19 @@ StyledRect {
} }
Behavior on currentSize { Behavior on currentSize {
enabled: BarConfig.workspaces.activeTrail enabled: Config.bar.workspaces.activeTrail
Anim {} Anim {}
} }
Behavior on offset { Behavior on offset {
enabled: !BarConfig.workspaces.activeTrail enabled: !Config.bar.workspaces.activeTrail
Anim {} Anim {}
} }
Behavior on size { Behavior on size {
enabled: !BarConfig.workspaces.activeTrail enabled: !Config.bar.workspaces.activeTrail
Anim {} Anim {}
} }

View file

@ -18,7 +18,7 @@ Item {
onOccupiedChanged: { onOccupiedChanged: {
let count = 0; let count = 0;
const start = groupOffset; const start = groupOffset;
const end = start + BarConfig.workspaces.shown; const end = start + Config.bar.workspaces.shown;
for (const [ws, occ] of Object.entries(occupied)) { for (const [ws, occ] of Object.entries(occupied)) {
if (ws > start && ws <= end && occ) { if (ws > start && ws <= end && occ) {
if (!occupied[ws - 1]) { if (!occupied[ws - 1]) {
@ -52,11 +52,11 @@ Item {
readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null
color: Colours.alpha(Colours.palette.m3surfaceContainerHigh, true) 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 x: start?.x ?? 0
y: start?.y ?? 0 y: start?.y ?? 0
implicitWidth: BarConfig.sizes.innerHeight implicitWidth: Config.bar.sizes.innerHeight
implicitHeight: end?.y + end?.height - start?.y implicitHeight: end?.y + end?.height - start?.y
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View file

@ -19,7 +19,7 @@ Item {
readonly property int ws: groupOffset + index + 1 readonly property int ws: groupOffset + index + 1
readonly property bool isOccupied: occupied[ws] ?? false 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.preferredWidth: childrenRect.width
Layout.preferredHeight: size Layout.preferredHeight: size
@ -27,24 +27,24 @@ Item {
StyledText { StyledText {
id: indicator id: indicator
readonly property string label: BarConfig.workspaces.label || root.ws readonly property string label: Config.bar.workspaces.label || root.ws
readonly property string occupiedLabel: BarConfig.workspaces.occupiedLabel || label readonly property string occupiedLabel: Config.bar.workspaces.occupiedLabel || label
readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label) readonly property string activeLabel: Config.bar.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label)
animate: true animate: true
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label 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 horizontalAlignment: StyledText.AlignHCenter
verticalAlignment: StyledText.AlignVCenter verticalAlignment: StyledText.AlignVCenter
width: BarConfig.sizes.innerHeight width: Config.bar.sizes.innerHeight
height: BarConfig.sizes.innerHeight height: Config.bar.sizes.innerHeight
} }
Loader { Loader {
id: windows id: windows
active: BarConfig.workspaces.showWindows active: Config.bar.workspaces.showWindows
asynchronous: true asynchronous: true
anchors.horizontalCenter: indicator.horizontalCenter anchors.horizontalCenter: indicator.horizontalCenter

View file

@ -14,7 +14,7 @@ Item {
acc[curr.id] = curr.lastIpcObject.windows > 0; acc[curr.id] = curr.lastIpcObject.windows > 0;
return acc; 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 implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight implicitHeight: layout.implicitHeight
@ -27,7 +27,7 @@ Item {
layer.smooth: true layer.smooth: true
Repeater { Repeater {
model: BarConfig.workspaces.shown model: Config.bar.workspaces.shown
Workspace { Workspace {
occupied: root.occupied occupied: root.occupied
@ -37,7 +37,7 @@ Item {
} }
Loader { Loader {
active: BarConfig.workspaces.occupiedBg active: Config.bar.workspaces.occupiedBg
asynchronous: true asynchronous: true
z: -1 z: -1
@ -51,7 +51,7 @@ Item {
} }
Loader { Loader {
active: BarConfig.workspaces.activeIndicator active: Config.bar.workspaces.activeIndicator
asynchronous: true asynchronous: true
sourceComponent: ActiveIndicator { sourceComponent: ActiveIndicator {

View file

@ -61,8 +61,8 @@ Item {
captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null
live: visible live: visible
constraintSize.width: BarConfig.sizes.windowPreviewSize constraintSize.width: Config.bar.sizes.windowPreviewSize
constraintSize.height: BarConfig.sizes.windowPreviewSize constraintSize.height: Config.bar.sizes.windowPreviewSize
} }
} }
} }

View file

@ -8,13 +8,13 @@ ShapePath {
required property Wrapper wrapper required property Wrapper wrapper
required property bool invertBottomRounding 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 bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
property real ibr: invertBottomRounding ? -1 : 1 property real ibr: invertBottomRounding ? -1 : 1
strokeWidth: -1 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathArc { PathArc {
relativeX: root.roundingX relativeX: root.roundingX

View file

@ -10,7 +10,7 @@ Column {
id: root id: root
spacing: Appearance.spacing.normal spacing: Appearance.spacing.normal
width: BarConfig.sizes.batteryWidth width: Config.bar.sizes.batteryWidth
StyledText { StyledText {
text: UPower.displayDevice.isLaptopBattery ? qsTr("Remaining: %1%").arg(Math.round(UPower.displayDevice.percentage * 100)) : qsTr("No battery detected") text: UPower.displayDevice.isLaptopBattery ? qsTr("Remaining: %1%").arg(Math.round(UPower.displayDevice.percentage * 100)) : qsTr("No battery detected")

View file

@ -80,7 +80,7 @@ StackView {
required property QsMenuEntry modelData required property QsMenuEntry modelData
implicitWidth: BarConfig.sizes.trayMenuWidth implicitWidth: Config.bar.sizes.trayMenuWidth
implicitHeight: modelData.isSeparator ? 1 : children.implicitHeight implicitHeight: modelData.isSeparator ? 1 : children.implicitHeight
radius: Appearance.rounding.full radius: Appearance.rounding.full
@ -153,7 +153,7 @@ StackView {
font.family: label.font.family font.family: label.font.family
elide: Text.ElideRight 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 { Loader {

View file

@ -7,12 +7,12 @@ ShapePath {
id: root id: root
required property Wrapper wrapper 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 bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathArc { PathArc {
relativeX: root.rounding relativeX: root.rounding

View file

@ -26,7 +26,7 @@ GridLayout {
Rect { Rect {
Layout.row: 0 Layout.row: 0
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.preferredWidth: DashboardConfig.sizes.weatherWidth Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
Layout.fillHeight: true Layout.fillHeight: true
Weather {} Weather {}

View file

@ -28,8 +28,8 @@ Item {
return `${Math.floor(length / 60)}:${Math.floor(length % 60).toString().padStart(2, "0")}`; 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 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 + DashboardConfig.sizes.mediaVisualiserSize * 2, details.implicitHeight, bongocat.implicitHeight) + 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 { Behavior on playerProgress {
NumberAnimation { NumberAnimation {
@ -41,7 +41,7 @@ Item {
Timer { Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false) running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
interval: DashboardConfig.mediaUpdateInterval interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true triggeredOnStart: true
repeat: true repeat: true
onTriggered: Players.active?.positionChanged() onTriggered: Players.active?.positionChanged()
@ -66,7 +66,7 @@ Item {
property color colour: Colours.palette.m3primary property color colour: Colours.palette.m3primary
anchors.fill: cover anchors.fill: cover
anchors.margins: -DashboardConfig.sizes.mediaVisualiserSize anchors.margins: -Config.dashboard.sizes.mediaVisualiserSize
onColourChanged: requestPaint() onColourChanged: requestPaint()
@ -81,7 +81,7 @@ Item {
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4; ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round"; ctx.lineCap = "round";
const size = DashboardConfig.sizes.mediaVisualiserSize; const size = Config.dashboard.sizes.mediaVisualiserSize;
const cx = centerX; const cx = centerX;
const cy = centerY; const cy = centerY;
const rx = innerX + ctx.lineWidth / 2; const rx = innerX + ctx.lineWidth / 2;
@ -116,10 +116,10 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left 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 implicitWidth: Config.dashboard.sizes.mediaCoverArtSize
implicitHeight: DashboardConfig.sizes.mediaCoverArtSize implicitHeight: Config.dashboard.sizes.mediaCoverArtSize
color: Colours.palette.m3surfaceContainerHigh color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full radius: Appearance.rounding.full

View file

@ -65,7 +65,7 @@ Row {
property bool primary property bool primary
readonly property real primaryMult: primary ? 1.2 : 1 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 fg1: Colours.palette.m3primary
property color fg2: Colours.palette.m3secondary property color fg2: Colours.palette.m3secondary
@ -74,8 +74,8 @@ Row {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
implicitWidth: DashboardConfig.sizes.resourceSize * primaryMult implicitWidth: Config.dashboard.sizes.resourceSize * primaryMult
implicitHeight: DashboardConfig.sizes.resourceSize * primaryMult implicitHeight: Config.dashboard.sizes.resourceSize * primaryMult
onValue1Changed: canvas.requestPaint() onValue1Changed: canvas.requestPaint()
onValue2Changed: canvas.requestPaint() onValue2Changed: canvas.requestPaint()

View file

@ -48,14 +48,14 @@ Item {
id: indicator id: indicator
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.topMargin: DashboardConfig.sizes.tabIndicatorSpacing anchors.topMargin: Config.dashboard.sizes.tabIndicatorSpacing
implicitWidth: bar.currentItem.implicitWidth implicitWidth: bar.currentItem.implicitWidth
implicitHeight: DashboardConfig.sizes.tabIndicatorHeight implicitHeight: Config.dashboard.sizes.tabIndicatorHeight
x: { x: {
const tab = bar.currentItem; 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; return width * tab.TabBar.index + (width - tab.implicitWidth) / 2;
} }
@ -69,7 +69,6 @@ Item {
color: Colours.palette.m3primary color: Colours.palette.m3primary
radius: Appearance.rounding.full radius: Appearance.rounding.full
} }
Behavior on x { Behavior on x {
@ -108,14 +107,17 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onPressed: ({x,y}) => { onPressed: ({
x,
y
}) => {
tab.TabBar.tabBar.setCurrentIndex(tab.TabBar.index); tab.TabBar.tabBar.setCurrentIndex(tab.TabBar.index);
const stateY = stateWrapper.y; const stateY = stateWrapper.y;
rippleAnim.x = x; rippleAnim.x = x;
rippleAnim.y = y - stateY; 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; const stateEndY = stateY + stateWrapper.height;
rippleAnim.radius = Math.sqrt(Math.max(dist(0, stateY), dist(0, stateEndY), dist(width, stateY), dist(width, stateEndY))); 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.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
implicitHeight: parent.height + DashboardConfig.sizes.tabIndicatorSpacing * 2 implicitHeight: parent.height + Config.dashboard.sizes.tabIndicatorSpacing * 2
color: "transparent" color: "transparent"
radius: Appearance.rounding.small radius: Appearance.rounding.small
@ -237,7 +239,6 @@ Item {
text: tab.text text: tab.text
color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant color: tab.current ? Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant
} }
} }
} }

View file

@ -8,7 +8,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
implicitWidth: DashboardConfig.sizes.dateTimeWidth implicitWidth: Config.dashboard.sizes.dateTimeWidth
StyledText { StyledText {
id: hours id: hours

View file

@ -19,7 +19,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
implicitWidth: DashboardConfig.sizes.mediaWidth implicitWidth: Config.dashboard.sizes.mediaWidth
Behavior on playerProgress { Behavior on playerProgress {
NumberAnimation { NumberAnimation {
@ -31,7 +31,7 @@ Item {
Timer { Timer {
running: root.shouldUpdate && (Players.active?.isPlaying ?? false) running: root.shouldUpdate && (Players.active?.isPlaying ?? false)
interval: DashboardConfig.mediaUpdateInterval interval: Config.dashboard.mediaUpdateInterval
triggeredOnStart: true triggeredOnStart: true
repeat: true repeat: true
onTriggered: Players.active?.positionChanged() onTriggered: Players.active?.positionChanged()
@ -43,16 +43,16 @@ Item {
ShapePath { ShapePath {
fillColor: "transparent" fillColor: "transparent"
strokeColor: Colours.palette.m3surfaceContainerHigh strokeColor: Colours.palette.m3surfaceContainerHigh
strokeWidth: DashboardConfig.sizes.mediaProgressThickness strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
PathAngleArc { PathAngleArc {
centerX: cover.x + cover.width / 2 centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2 centerY: cover.y + cover.height / 2
radiusX: (cover.width + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
radiusY: (cover.height + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
startAngle: -90 - DashboardConfig.sizes.mediaProgressSweep / 2 startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
sweepAngle: DashboardConfig.sizes.mediaProgressSweep sweepAngle: Config.dashboard.sizes.mediaProgressSweep
} }
Behavior on strokeColor { Behavior on strokeColor {
@ -67,16 +67,16 @@ Item {
ShapePath { ShapePath {
fillColor: "transparent" fillColor: "transparent"
strokeColor: Colours.palette.m3primary strokeColor: Colours.palette.m3primary
strokeWidth: DashboardConfig.sizes.mediaProgressThickness strokeWidth: Config.dashboard.sizes.mediaProgressThickness
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
PathAngleArc { PathAngleArc {
centerX: cover.x + cover.width / 2 centerX: cover.x + cover.width / 2
centerY: cover.y + cover.height / 2 centerY: cover.y + cover.height / 2
radiusX: (cover.width + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small radiusX: (cover.width + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
radiusY: (cover.height + DashboardConfig.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small radiusY: (cover.height + Config.dashboard.sizes.mediaProgressThickness) / 2 + Appearance.spacing.small
startAngle: -90 - DashboardConfig.sizes.mediaProgressSweep / 2 startAngle: -90 - Config.dashboard.sizes.mediaProgressSweep / 2
sweepAngle: DashboardConfig.sizes.mediaProgressSweep * root.playerProgress sweepAngle: Config.dashboard.sizes.mediaProgressSweep * root.playerProgress
} }
Behavior on strokeColor { Behavior on strokeColor {
@ -95,7 +95,7 @@ Item {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right 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 implicitHeight: width
color: Colours.palette.m3surfaceContainerHigh color: Colours.palette.m3surfaceContainerHigh

View file

@ -49,7 +49,7 @@ Row {
anchors.bottom: icon.top anchors.bottom: icon.top
anchors.bottomMargin: Appearance.spacing.small anchors.bottomMargin: Appearance.spacing.small
implicitWidth: DashboardConfig.sizes.resourceProgessThickness implicitWidth: Config.dashboard.sizes.resourceProgessThickness
color: Colours.palette.m3surfaceContainerHigh color: Colours.palette.m3surfaceContainerHigh
radius: Appearance.rounding.full radius: Appearance.rounding.full

View file

@ -90,7 +90,7 @@ Row {
id: icon id: icon
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: (DashboardConfig.sizes.infoIconSize - implicitWidth) / 2 anchors.leftMargin: (Config.dashboard.sizes.infoIconSize - implicitWidth) / 2
text: line.icon text: line.icon
color: line.colour color: line.colour
@ -109,7 +109,7 @@ Row {
text: `: ${line.text}` text: `: ${line.text}`
font.pointSize: Appearance.font.size.normal font.pointSize: Appearance.font.size.normal
width: DashboardConfig.sizes.infoWidth width: Config.dashboard.sizes.infoWidth
elide: Text.ElideRight elide: Text.ElideRight
} }
} }

View file

@ -16,7 +16,7 @@ Shape {
required property Item bar required property Item bar
anchors.fill: parent anchors.fill: parent
anchors.margins: BorderConfig.thickness anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth anchors.leftMargin: bar.implicitWidth
preferredRendererType: Shape.CurveRenderer preferredRendererType: Shape.CurveRenderer
opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 opacity: Colours.transparency.enabled ? Colours.transparency.base : 1

View file

@ -16,7 +16,7 @@ Item {
id: rect id: rect
anchors.fill: parent anchors.fill: parent
color: Colours.alpha(BorderConfig.colour, false) color: Colours.alpha(Config.border.colour, false)
visible: false visible: false
} }
@ -29,9 +29,9 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: BorderConfig.thickness anchors.margins: Config.border.thickness
anchors.leftMargin: root.bar.implicitWidth anchors.leftMargin: root.bar.implicitWidth
radius: BorderConfig.rounding radius: Config.border.rounding
} }
} }

View file

@ -33,9 +33,9 @@ Variants {
mask: Region { mask: Region {
x: bar.implicitWidth x: bar.implicitWidth
y: BorderConfig.thickness y: Config.border.thickness
width: win.width - bar.implicitWidth - BorderConfig.thickness width: win.width - bar.implicitWidth - Config.border.thickness
height: win.height - BorderConfig.thickness * 2 height: win.height - Config.border.thickness * 2
intersection: Intersection.Xor intersection: Intersection.Xor
regions: regions.instances regions: regions.instances
@ -55,7 +55,7 @@ Variants {
required property Item modelData required property Item modelData
x: modelData.x + bar.implicitWidth x: modelData.x + bar.implicitWidth
y: modelData.y + BorderConfig.thickness y: modelData.y + Config.border.thickness
width: modelData.width width: modelData.width
height: modelData.height height: modelData.height
intersection: Intersection.Subtract intersection: Intersection.Subtract

View file

@ -31,6 +31,6 @@ Scope {
component ExclusionZone: StyledWindow { component ExclusionZone: StyledWindow {
screen: root.screen screen: root.screen
name: "border-exclusion" name: "border-exclusion"
exclusiveZone: BorderConfig.thickness exclusiveZone: Config.border.thickness
} }
} }

View file

@ -20,8 +20,8 @@ MouseArea {
property bool osdShortcutActive property bool osdShortcutActive
function withinPanelHeight(panel: Item, x: real, y: real): bool { function withinPanelHeight(panel: Item, x: real, y: real): bool {
const panelY = BorderConfig.thickness + panel.y; const panelY = Config.border.thickness + panel.y;
return y >= panelY - BorderConfig.rounding && y <= panelY + panel.height + BorderConfig.rounding; return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
} }
function inRightPanel(panel: Item, x: real, y: real): bool { function inRightPanel(panel: Item, x: real, y: real): bool {
@ -30,7 +30,7 @@ MouseArea {
function inTopPanel(panel: Item, x: real, y: real): bool { function inTopPanel(panel: Item, x: real, y: real): bool {
const panelX = bar.implicitWidth + panel.x; 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 anchors.fill: parent
@ -51,7 +51,10 @@ MouseArea {
} }
} }
onPositionChanged: ({x, y}) => { onPositionChanged: ({
x,
y
}) => {
// Show osd on hover // Show osd on hover
const showOsd = inRightPanel(panels.osd, x, y); const showOsd = inRightPanel(panels.osd, x, y);
@ -68,9 +71,9 @@ MouseArea {
// Show/hide session on drag // Show/hide session on drag
if (pressed && withinPanelHeight(panels.session, x, y)) { if (pressed && withinPanelHeight(panels.session, x, y)) {
const dragX = x - dragStart.x; const dragX = x - dragStart.x;
if (dragX < -SessionConfig.dragThreshold) if (dragX < -Config.session.dragThreshold)
visibilities.session = true; visibilities.session = true;
else if (dragX > SessionConfig.dragThreshold) else if (dragX > Config.session.dragThreshold)
visibilities.session = false; visibilities.session = false;
} }

View file

@ -24,7 +24,7 @@ Item {
readonly property BarPopouts.Wrapper popouts: popouts readonly property BarPopouts.Wrapper popouts: popouts
anchors.fill: parent anchors.fill: parent
anchors.margins: BorderConfig.thickness anchors.margins: Config.border.thickness
anchors.leftMargin: bar.implicitWidth anchors.leftMargin: bar.implicitWidth
Component.onCompleted: Visibilities.panels[screen] = this Component.onCompleted: Visibilities.panels[screen] = this
@ -83,7 +83,7 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.top anchors.verticalCenter: parent.top
anchors.verticalCenterOffset: { 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); const diff = root.height - Math.floor(off + implicitHeight / 2);
if (diff < 0) if (diff < 0)
return off + diff; return off + diff;

View file

@ -9,7 +9,7 @@ Item {
required property Actions.Action modelData required property Actions.Action modelData
required property var list required property var list
implicitHeight: LauncherConfig.sizes.itemHeight implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left anchors.left: parent?.left
anchors.right: parent?.right anchors.right: parent?.right

View file

@ -96,7 +96,7 @@ Singleton {
})) }))
function fuzzyQuery(search: string): var { 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, all: true,
keys: ["name", "desc"], keys: ["name", "desc"],
scoreFn: r => r[0].score > 0 ? r[0].score * 0.9 + r[1].score * 0.1 : 0 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 { function autocomplete(list: AppList, text: string): void {
list.search.text = `${LauncherConfig.actionPrefix}${text} `; list.search.text = `${Config.launcher.actionPrefix}${text} `;
} }
Process { Process {

View file

@ -11,7 +11,7 @@ Item {
required property DesktopEntry modelData required property DesktopEntry modelData
required property PersistentProperties visibilities required property PersistentProperties visibilities
implicitHeight: LauncherConfig.sizes.itemHeight implicitHeight: Config.launcher.sizes.itemHeight
anchors.left: parent?.left anchors.left: parent?.left
anchors.right: parent?.right anchors.right: parent?.right

View file

@ -14,14 +14,14 @@ ListView {
required property TextField search required property TextField search
required property PersistentProperties visibilities required property PersistentProperties visibilities
property bool isAction: search.text.startsWith(LauncherConfig.actionPrefix) property bool isAction: search.text.startsWith(Config.launcher.actionPrefix)
function getModelValues() { function getModelValues() {
let text = search.text; let text = search.text;
if (isAction) if (isAction)
return Actions.fuzzyQuery(text); return Actions.fuzzyQuery(text);
if (text.startsWith(LauncherConfig.actionPrefix)) if (text.startsWith(Config.launcher.actionPrefix))
text = search.text.slice(LauncherConfig.actionPrefix.length); text = search.text.slice(Config.launcher.actionPrefix.length);
return Apps.fuzzyQuery(text); return Apps.fuzzyQuery(text);
} }
@ -32,7 +32,7 @@ ListView {
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
orientation: Qt.Vertical 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 highlightMoveDuration: Appearance.anim.durations.normal
highlightResizeDuration: 0 highlightResizeDuration: 0

View file

@ -7,12 +7,12 @@ ShapePath {
id: root id: root
required property Wrapper wrapper 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 bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
strokeWidth: -1 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathArc { PathArc {
relativeX: root.rounding relativeX: root.rounding

View file

@ -74,7 +74,7 @@ Item {
topPadding: Appearance.padding.larger topPadding: Appearance.padding.larger
bottomPadding: 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 background: null
onAccepted: { onAccepted: {
@ -83,7 +83,7 @@ Item {
if (list.showWallpapers) { if (list.showWallpapers) {
Wallpapers.setWallpaper(currentItem.modelData.path); Wallpapers.setWallpaper(currentItem.modelData.path);
root.visibilities.launcher = false; root.visibilities.launcher = false;
} else if (text.startsWith(LauncherConfig.actionPrefix)) { } else if (text.startsWith(Config.launcher.actionPrefix)) {
currentItem.modelData.onClicked(list.currentList); currentItem.modelData.onClicked(list.currentList);
} else { } else {
Apps.launch(currentItem.modelData); Apps.launch(currentItem.modelData);

View file

@ -15,7 +15,7 @@ Item {
required property int padding required property int padding
required property int rounding 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 property var currentList: (showWallpapers ? wallpaperList : appList).item
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -29,7 +29,7 @@ Item {
name: "apps" name: "apps"
PropertyChanges { PropertyChanges {
root.implicitWidth: LauncherConfig.sizes.itemWidth root.implicitWidth: Config.launcher.sizes.itemWidth
root.implicitHeight: Math.max(empty.height, appList.height) root.implicitHeight: Math.max(empty.height, appList.height)
appList.active: true appList.active: true
} }
@ -43,8 +43,8 @@ Item {
name: "wallpapers" name: "wallpapers"
PropertyChanges { PropertyChanges {
root.implicitWidth: Math.max(LauncherConfig.sizes.itemWidth, wallpaperList.width) root.implicitWidth: Math.max(Config.launcher.sizes.itemWidth, wallpaperList.width)
root.implicitHeight: LauncherConfig.sizes.wallpaperHeight root.implicitHeight: Config.launcher.sizes.wallpaperHeight
wallpaperList.active: true wallpaperList.active: true
} }
} }

View file

@ -42,7 +42,7 @@ StyledRect {
path: root.modelData.path path: root.modelData.path
smooth: !root.PathView.view.moving smooth: !root.PathView.view.moving
width: LauncherConfig.sizes.wallpaperWidth width: Config.launcher.sizes.wallpaperWidth
height: width / 16 * 9 height: width / 16 * 9
} }

View file

@ -14,8 +14,8 @@ PathView {
const screenWidth = QsWindow.window?.screen.width * 0.8; const screenWidth = QsWindow.window?.screen.width * 0.8;
if (!screenWidth) if (!screenWidth)
return 0; return 0;
const itemWidth = LauncherConfig.sizes.wallpaperWidth * 0.8; const itemWidth = Config.launcher.sizes.wallpaperWidth * 0.8;
const max = LauncherConfig.maxWallpapers; const max = Config.launcher.maxWallpapers;
if (max * itemWidth > screenWidth) { if (max * itemWidth > screenWidth) {
const items = Math.floor(screenWidth / itemWidth); const items = Math.floor(screenWidth / itemWidth);
return items > 1 && items % 2 === 0 ? items - 1 : items; return items > 1 && items % 2 === 0 ? items - 1 : items;
@ -43,7 +43,7 @@ PathView {
Wallpapers.preview(currentItem.modelData.path); 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 pathItemCount: numItems
cacheItemCount: 4 cacheItemCount: 4

View file

@ -8,13 +8,13 @@ ShapePath {
id: root id: root
required property Wrapper wrapper 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 bool flatten: wrapper.height < rounding * 2
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding 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 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathLine { PathLine {
relativeX: -(root.wrapper.width + root.rounding) relativeX: -(root.wrapper.width + root.rounding)

View file

@ -14,7 +14,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
implicitWidth: NotifsConfig.sizes.width + padding * 2 implicitWidth: Config.notifs.sizes.width + padding * 2
implicitHeight: { implicitHeight: {
const count = list.count; const count = list.count;
if (count === 0) if (count === 0)
@ -29,19 +29,19 @@ Item {
const panel = Visibilities.panels[screen]; const panel = Visibilities.panels[screen];
if (visibilities && panel) { if (visibilities && panel) {
if (visibilities.osd) { if (visibilities.osd) {
const h = panel.osd.y - BorderConfig.rounding * 2; const h = panel.osd.y - Config.border.rounding * 2;
if (height > h) if (height > h)
height = h; height = h;
} }
if (visibilities.session) { if (visibilities.session) {
const h = panel.session.y - BorderConfig.rounding * 2; const h = panel.session.y - Config.border.rounding * 2;
if (height > h) if (height > h)
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 { ClippingWrapperRectangle {
@ -108,7 +108,7 @@ Item {
Anim { Anim {
target: notif target: notif
property: "x" 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 duration: Appearance.anim.durations.normal
easing.bezierCurve: Appearance.anim.curves.emphasized easing.bezierCurve: Appearance.anim.curves.emphasized
} }

View file

@ -20,10 +20,10 @@ StyledRect {
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
implicitWidth: NotifsConfig.sizes.width implicitWidth: Config.notifs.sizes.width
implicitHeight: inner.implicitHeight implicitHeight: inner.implicitHeight
x: NotifsConfig.sizes.width x: Config.notifs.sizes.width
Component.onCompleted: x = 0 Component.onCompleted: x = 0
RetainableLock { RetainableLock {
@ -52,7 +52,7 @@ StyledRect {
root.modelData.notification.dismiss(); root.modelData.notification.dismiss();
} }
onReleased: event => { 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; root.x = 0;
else else
root.modelData.popup = false; root.modelData.popup = false;
@ -60,12 +60,12 @@ StyledRect {
onPositionChanged: event => { onPositionChanged: event => {
if (pressed) { if (pressed) {
const diffY = event.y - startY; const diffY = event.y - startY;
if (Math.abs(diffY) > NotifsConfig.expandThreshold) if (Math.abs(diffY) > Config.notifs.expandThreshold)
root.expanded = diffY > 0; root.expanded = diffY > 0;
} }
} }
onClicked: event => { onClicked: event => {
if (!NotifsConfig.actionOnClick || event.button !== Qt.LeftButton) if (!Config.notifs.actionOnClick || event.button !== Qt.LeftButton)
return; return;
const actions = root.modelData.actions; const actions = root.modelData.actions;
@ -107,14 +107,14 @@ StyledRect {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
width: NotifsConfig.sizes.image width: Config.notifs.sizes.image
height: NotifsConfig.sizes.image height: Config.notifs.sizes.image
visible: root.hasImage || root.hasAppIcon visible: root.hasImage || root.hasAppIcon
sourceComponent: ClippingRectangle { sourceComponent: ClippingRectangle {
radius: Appearance.rounding.full radius: Appearance.rounding.full
implicitWidth: NotifsConfig.sizes.image implicitWidth: Config.notifs.sizes.image
implicitHeight: NotifsConfig.sizes.image implicitHeight: Config.notifs.sizes.image
Image { Image {
anchors.fill: parent anchors.fill: parent
@ -140,8 +140,8 @@ StyledRect {
sourceComponent: StyledRect { sourceComponent: StyledRect {
radius: Appearance.rounding.full radius: Appearance.rounding.full
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colours.palette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer 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 implicitWidth: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image
implicitHeight: root.hasImage ? NotifsConfig.sizes.badge : NotifsConfig.sizes.image implicitHeight: root.hasImage ? Config.notifs.sizes.badge : Config.notifs.sizes.image
Loader { Loader {
id: icon id: icon

View file

@ -7,12 +7,12 @@ ShapePath {
id: root id: root
required property Wrapper wrapper 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 bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
strokeWidth: -1 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathArc { PathArc {
relativeX: -root.roundingX relativeX: -root.roundingX

View file

@ -28,8 +28,8 @@ Column {
value: Audio.volume value: Audio.volume
onMoved: Audio.setVolume(value) onMoved: Audio.setVolume(value)
implicitWidth: OsdConfig.sizes.sliderWidth implicitWidth: Config.osd.sizes.sliderWidth
implicitHeight: OsdConfig.sizes.sliderHeight implicitHeight: Config.osd.sizes.sliderHeight
} }
VerticalSlider { VerticalSlider {
@ -37,7 +37,7 @@ Column {
value: root.monitor?.brightness ?? 0 value: root.monitor?.brightness ?? 0
onMoved: root.monitor?.setBrightness(value) onMoved: root.monitor?.setBrightness(value)
implicitWidth: OsdConfig.sizes.sliderWidth implicitWidth: Config.osd.sizes.sliderWidth
implicitHeight: OsdConfig.sizes.sliderHeight implicitHeight: Config.osd.sizes.sliderHeight
} }
} }

View file

@ -39,7 +39,7 @@ Scope {
Timer { Timer {
id: timer id: timer
interval: OsdConfig.hideDelay interval: Config.osd.hideDelay
onTriggered: { onTriggered: {
if (!root.hovered) if (!root.hovered)
root.visibilities.osd = false; root.visibilities.osd = false;

View file

@ -7,12 +7,12 @@ ShapePath {
id: root id: root
required property Wrapper wrapper 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 bool flatten: wrapper.width < rounding * 2
readonly property real roundingX: flatten ? wrapper.width / 2 : rounding readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
strokeWidth: -1 strokeWidth: -1
fillColor: BorderConfig.colour fillColor: Config.border.colour
PathArc { PathArc {
relativeX: -root.roundingX relativeX: -root.roundingX

View file

@ -48,8 +48,8 @@ Column {
} }
AnimatedImage { AnimatedImage {
width: SessionConfig.sizes.button width: Config.session.sizes.button
height: SessionConfig.sizes.button height: Config.session.sizes.button
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
@ -84,8 +84,8 @@ Column {
required property string icon required property string icon
required property list<string> command required property list<string> command
implicitWidth: SessionConfig.sizes.button implicitWidth: Config.session.sizes.button
implicitHeight: SessionConfig.sizes.button implicitHeight: Config.session.sizes.button
radius: Appearance.rounding.large radius: Appearance.rounding.large
color: button.activeFocus ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer color: button.activeFocus ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer

View file

@ -11,7 +11,7 @@ Singleton {
Process { Process {
running: true 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 { stdout: SplitParser {
onRead: data => root.values = data.slice(0, -1).split(";").map(v => parseInt(v, 10)) onRead: data => root.values = data.slice(0, -1).split(";").map(v => parseInt(v, 10))
} }

View file

@ -80,9 +80,9 @@ Singleton {
readonly property Timer timer: Timer { readonly property Timer timer: Timer {
running: true running: true
interval: notif.notification.expireTimeout > 0 ? notif.notification.expireTimeout : NotifsConfig.defaultExpireTimeout interval: notif.notification.expireTimeout > 0 ? notif.notification.expireTimeout : Config.notifs.defaultExpireTimeout
onTriggered: { onTriggered: {
if (NotifsConfig.expire) if (Config.notifs.expire)
notif.popup = false; notif.popup = false;
} }
} }

View file

@ -13,6 +13,7 @@ Singleton {
readonly property url data: `${StandardPaths.standardLocations(StandardPaths.GenericDataLocation)[0]}/caelestia` readonly property url data: `${StandardPaths.standardLocations(StandardPaths.GenericDataLocation)[0]}/caelestia`
readonly property url state: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[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 cache: `${StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]}/caelestia`
readonly property url config: `${StandardPaths.standardLocations(StandardPaths.GenericConfigLocation)[0]}/caelestia`
readonly property url imagecache: `${cache}/imagecache` readonly property url imagecache: `${cache}/imagecache`