From 9a079fe2f19caef7fdab4466f4067cf38b4d1ec9 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 17 Apr 2026 23:13:54 +0200 Subject: [PATCH] standardize services import alias to S in applets and lock --- shell/applets/CpuApplet.qml | 46 ++++++++-------- shell/applets/DiskApplet.qml | 20 +++---- shell/applets/HexWaveBackground.qml | 12 ++--- shell/applets/MemoryApplet.qml | 82 ++++++++++++++--------------- shell/applets/MprisApplet.qml | 62 +++++++++++----------- shell/applets/TemperatureApplet.qml | 48 ++++++++--------- shell/applets/VolumeApplet.qml | 60 ++++++++++----------- shell/lock/Lock.qml | 4 +- shell/lock/LockInput.qml | 22 ++++---- shell/lock/LockSurface.qml | 48 ++++++++--------- 10 files changed, 202 insertions(+), 202 deletions(-) diff --git a/shell/applets/CpuApplet.qml b/shell/applets/CpuApplet.qml index 4b8ae88..82528d6 100644 --- a/shell/applets/CpuApplet.qml +++ b/shell/applets/CpuApplet.qml @@ -1,5 +1,5 @@ import QtQuick -import "../services" as M +import "../services" as S Column { id: root @@ -14,8 +14,8 @@ Column { function _loadColor(pct) { const t = Math.max(0, Math.min(100, pct)) / 100; - const a = t < 0.5 ? M.Theme.base0B : M.Theme.base0A; - const b = t < 0.5 ? M.Theme.base0A : M.Theme.base08; + const a = t < 0.5 ? S.Theme.base0B : S.Theme.base0A; + const b = t < 0.5 ? S.Theme.base0A : S.Theme.base08; const u = t < 0.5 ? t * 2 : (t - 0.5) * 2; return Qt.rgba(a.r + (b.r - a.r) * u, a.g + (b.g - a.g) * u, a.b + (b.b - a.b) * u, 1); } @@ -54,7 +54,7 @@ Column { anchors.horizontalCenter: parent.horizontalCenter width: parent.width - 16 height: 1 - color: M.Theme.base03 + color: S.Theme.base03 } // Row content pinned to bottom of delegate @@ -69,9 +69,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: index - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily width: 16 } @@ -86,7 +86,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 2 } @@ -147,9 +147,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: parent.parent._f.toFixed(2) - color: parent.parent._throttled ? M.Theme.base08 : M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: parent.parent._throttled ? S.Theme.base08 : S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily width: 34 horizontalAlignment: Text.AlignRight } @@ -162,7 +162,7 @@ Column { width: root.width - 16 height: 1 anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 + color: S.Theme.base03 } Item { @@ -174,9 +174,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "PROCESS" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily font.letterSpacing: 1 } @@ -185,9 +185,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "CPU" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily font.letterSpacing: 1 } } @@ -206,9 +206,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.cmd - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily elide: Text.ElideRight width: parent.width - 80 } @@ -219,8 +219,8 @@ Column { anchors.verticalCenter: parent.verticalCenter text: modelData.cpu.toFixed(1) + "%" color: root._loadColor(modelData.cpu) - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily width: 36 horizontalAlignment: Text.AlignRight } diff --git a/shell/applets/DiskApplet.qml b/shell/applets/DiskApplet.qml index 88f2e31..16dee79 100644 --- a/shell/applets/DiskApplet.qml +++ b/shell/applets/DiskApplet.qml @@ -1,5 +1,5 @@ import QtQuick -import "../services" as M +import "../services" as S Column { id: root @@ -19,8 +19,8 @@ Column { function _barColor(pct) { const t = Math.max(0, Math.min(100, pct)) / 100; - const a = t < 0.5 ? M.Theme.base0B : M.Theme.base0A; - const b = t < 0.5 ? M.Theme.base0A : M.Theme.base08; + const a = t < 0.5 ? S.Theme.base0B : S.Theme.base0A; + const b = t < 0.5 ? S.Theme.base0A : S.Theme.base08; const u = t < 0.5 ? t * 2 : (t - 0.5) * 2; return Qt.rgba(a.r + (b.r - a.r) * u, a.g + (b.g - a.g) * u, a.b + (b.b - a.b) * u, 1); } @@ -39,9 +39,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.target - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily elide: Text.ElideRight width: 72 } @@ -57,7 +57,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 2 } @@ -80,9 +80,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root._fmt(modelData.usedBytes) + "/" + root._fmt(modelData.totalBytes) - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily width: 72 horizontalAlignment: Text.AlignRight } diff --git a/shell/applets/HexWaveBackground.qml b/shell/applets/HexWaveBackground.qml index 72ae4f2..57cb651 100644 --- a/shell/applets/HexWaveBackground.qml +++ b/shell/applets/HexWaveBackground.qml @@ -1,16 +1,16 @@ import QtQuick import Quickshell -import "../services" as M +import "../services" as S Item { id: root property bool running: false - property bool reducedMotion: M.Theme.reducedMotion + property bool reducedMotion: S.Theme.reducedMotion Rectangle { anchors.fill: parent - color: M.Theme.base01 + color: S.Theme.base01 } ShaderEffect { @@ -24,9 +24,9 @@ Item { property real uGlitch: 0 property real uGlitchSeed: 0.0 property vector4d uResolution: Qt.vector4d(width, height, 0, 0) - property color uC0: M.Theme.base0C - property color uC1: M.Theme.base0E - property color uC2: M.Theme.base09 + property color uC0: S.Theme.base0C + property color uC1: S.Theme.base0E + property color uC2: S.Theme.base09 Connections { target: root diff --git a/shell/applets/MemoryApplet.qml b/shell/applets/MemoryApplet.qml index e8dc4bd..4244332 100644 --- a/shell/applets/MemoryApplet.qml +++ b/shell/applets/MemoryApplet.qml @@ -1,5 +1,5 @@ import QtQuick -import "../services" as M +import "../services" as S Column { id: root @@ -35,7 +35,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 3 } @@ -43,7 +43,7 @@ Column { Rectangle { width: parent.width * Math.min(1, (root.usedGb + root.cachedGb) / Math.max(root.totalGb, 0.001)) height: parent.height - color: M.Theme.base0D + color: S.Theme.base0D opacity: 0.4 radius: 3 Behavior on width { @@ -79,7 +79,7 @@ Column { anchors.rightMargin: 12 height: 18 - property var _hist: M.SystemStats.memHistory + property var _hist: S.SystemStats.memHistory property color _col: root.accentColor on_HistChanged: if (root.active) @@ -119,9 +119,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "Used" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Text { @@ -129,9 +129,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root._fmt(root.usedGb) - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } } @@ -144,9 +144,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "Cached" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Text { @@ -154,9 +154,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root._fmt(root.cachedGb) - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } } @@ -169,9 +169,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "Available" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Text { @@ -179,9 +179,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root._fmt(root.availGb) - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } } @@ -194,9 +194,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "Total" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Text { @@ -204,9 +204,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root._fmt(root.totalGb) - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } } @@ -215,7 +215,7 @@ Column { width: root.width - 16 height: 1 anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 + color: S.Theme.base03 } Item { @@ -227,9 +227,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "PROCESS" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily font.letterSpacing: 1 } @@ -238,9 +238,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "MEM" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily font.letterSpacing: 1 } } @@ -259,9 +259,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.cmd - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily elide: Text.ElideRight width: parent.width - 80 } @@ -271,9 +271,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.mem.toFixed(1) + "%" - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily width: 36 horizontalAlignment: Text.AlignRight } diff --git a/shell/applets/MprisApplet.qml b/shell/applets/MprisApplet.qml index ca63f92..264527a 100644 --- a/shell/applets/MprisApplet.qml +++ b/shell/applets/MprisApplet.qml @@ -1,6 +1,6 @@ import QtQuick import Quickshell.Services.Mpris -import "../services" as M +import "../services" as S Column { id: root @@ -23,7 +23,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 } // Outgoing art - snaps to current opacity, then fades out @@ -137,7 +137,7 @@ Column { } GradientStop { position: 1 - color: M.Theme.base01 + color: S.Theme.base01 } } } @@ -145,9 +145,9 @@ Column { Text { anchors.centerIn: parent text: "\uF001" - color: M.Theme.base04 + color: S.Theme.base04 font.pixelSize: 28 - font.family: M.Theme.iconFontFamily + font.family: S.Theme.iconFontFamily visible: !_artImg._hasArt } } @@ -169,9 +169,9 @@ Column { Text { width: parent.width text: root.player?.trackTitle || "No track" - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize + 1 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize + 1 + font.family: S.Theme.fontFamily font.bold: true elide: Text.ElideRight } @@ -185,9 +185,9 @@ Column { const artist = Array.isArray(p.trackArtists) ? p.trackArtists.join(", ") : (p.trackArtists || ""); return [artist, p.trackAlbum].filter(s => s).join(" \u2014 "); } - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily elide: Text.ElideRight visible: text !== "" } @@ -214,18 +214,18 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: parent._fmtTime(parent.pos) - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Text { anchors.right: parent.right anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: parent._fmtTime(parent.dur) - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily } Item { @@ -236,7 +236,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 2 } Rectangle { @@ -259,9 +259,9 @@ Column { Text { text: "\uF048" - color: root.player?.canGoPrevious ? M.Theme.base05 : M.Theme.base03 - font.pixelSize: M.Theme.fontSize + 4 - font.family: M.Theme.iconFontFamily + color: root.player?.canGoPrevious ? S.Theme.base05 : S.Theme.base03 + font.pixelSize: S.Theme.fontSize + 4 + font.family: S.Theme.iconFontFamily anchors.verticalCenter: parent.verticalCenter TapHandler { cursorShape: Qt.PointingHandCursor @@ -273,8 +273,8 @@ Column { Text { text: root.playing ? "\uF04C" : "\uF04B" color: root.accentColor - font.pixelSize: M.Theme.fontSize + 8 - font.family: M.Theme.iconFontFamily + font.pixelSize: S.Theme.fontSize + 8 + font.family: S.Theme.iconFontFamily anchors.verticalCenter: parent.verticalCenter TapHandler { cursorShape: Qt.PointingHandCursor @@ -284,9 +284,9 @@ Column { Text { text: "\uF051" - color: root.player?.canGoNext ? M.Theme.base05 : M.Theme.base03 - font.pixelSize: M.Theme.fontSize + 4 - font.family: M.Theme.iconFontFamily + color: root.player?.canGoNext ? S.Theme.base05 : S.Theme.base03 + font.pixelSize: S.Theme.fontSize + 4 + font.family: S.Theme.iconFontFamily anchors.verticalCenter: parent.verticalCenter TapHandler { cursorShape: Qt.PointingHandCursor @@ -328,8 +328,8 @@ Column { width: _pLabel.implicitWidth + 12 height: 18 radius: 9 - color: _active ? M.Theme.base02 : (pHover.hovered ? M.Theme.base02 : "transparent") - border.color: _active ? root.accentColor : M.Theme.base03 + color: _active ? S.Theme.base02 : (pHover.hovered ? S.Theme.base02 : "transparent") + border.color: _active ? root.accentColor : S.Theme.base03 border.width: _active ? 1 : 0 anchors.verticalCenter: parent.verticalCenter @@ -337,9 +337,9 @@ Column { id: _pLabel anchors.centerIn: parent text: modelData.identity ?? "Player" - color: _active ? root.accentColor : M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: _active ? root.accentColor : S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily font.bold: _active } diff --git a/shell/applets/TemperatureApplet.qml b/shell/applets/TemperatureApplet.qml index 49129aa..bc7ed73 100644 --- a/shell/applets/TemperatureApplet.qml +++ b/shell/applets/TemperatureApplet.qml @@ -1,5 +1,5 @@ import QtQuick -import "../services" as M +import "../services" as S Column { id: root @@ -14,7 +14,7 @@ Column { property bool active: true property string deviceFilter: "" - property color stateColor: temp > hot ? M.Theme.base08 : temp > warm ? M.Theme.base0A : root.accentColor + property color stateColor: temp > hot ? S.Theme.base08 : temp > warm ? S.Theme.base0A : root.accentColor Behavior on stateColor { ColorAnimation { duration: 300 @@ -23,8 +23,8 @@ Column { function _tempColor(celsius) { const t = Math.max(0, Math.min(100, celsius)) / 100; - const a = t < 0.5 ? M.Theme.base0B : M.Theme.base0A; - const b = t < 0.5 ? M.Theme.base0A : M.Theme.base08; + const a = t < 0.5 ? S.Theme.base0B : S.Theme.base0A; + const b = t < 0.5 ? S.Theme.base0A : S.Theme.base08; const u = t < 0.5 ? t * 2 : (t - 0.5) * 2; return Qt.rgba(a.r + (b.r - a.r) * u, a.g + (b.g - a.g) * u, a.b + (b.b - a.b) * u, 1); } @@ -40,8 +40,8 @@ Column { anchors.verticalCenter: parent.verticalCenter text: root.temp + "\u00B0C" color: root.stateColor - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.fontFamily + font.pixelSize: S.Theme.fontSize + font.family: S.Theme.fontFamily font.bold: true width: _tempSizer.implicitWidth horizontalAlignment: Text.AlignRight @@ -71,7 +71,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 3 } @@ -95,7 +95,7 @@ Column { width: 1 height: parent.height + 4 anchors.verticalCenter: parent.verticalCenter - color: M.Theme.base0A + color: S.Theme.base0A opacity: 0.6 } @@ -105,7 +105,7 @@ Column { width: 1 height: parent.height + 4 anchors.verticalCenter: parent.verticalCenter - color: M.Theme.base08 + color: S.Theme.base08 opacity: 0.6 } } @@ -149,7 +149,7 @@ Column { // Warm threshold line const warmY = height - height * (root.warm / 100); - ctx.strokeStyle = M.Theme.base0A.toString(); + ctx.strokeStyle = S.Theme.base0A.toString(); ctx.globalAlpha = 0.3; ctx.lineWidth = 1; ctx.setLineDash([3, 3]); @@ -160,7 +160,7 @@ Column { // Hot threshold line const hotY = height - height * (root.hot / 100); - ctx.strokeStyle = M.Theme.base08.toString(); + ctx.strokeStyle = S.Theme.base08.toString(); ctx.beginPath(); ctx.moveTo(0, hotY); ctx.lineTo(width, hotY); @@ -173,7 +173,7 @@ Column { const offset = maxSamples - d.length; for (let i = 0; i < d.length; i++) { const barH = Math.max(1, height * d[i] / 100); - const barColor = d[i] > root.hot ? M.Theme.base08 : d[i] > root.warm ? M.Theme.base0A : _col; + const barColor = d[i] > root.hot ? S.Theme.base08 : d[i] > root.warm ? S.Theme.base0A : _col; ctx.fillStyle = barColor.toString(); ctx.fillRect((offset + i) * bw, height - barH, Math.max(1, bw - 0.5), barH); } @@ -190,9 +190,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "warm " + root.warm + "\u00B0 hot " + root.hot + "\u00B0" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily font.letterSpacing: 0.5 } @@ -201,9 +201,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: "10 min" - color: M.Theme.base03 - font.pixelSize: M.Theme.fontSize - 3 - font.family: M.Theme.fontFamily + color: S.Theme.base03 + font.pixelSize: S.Theme.fontSize - 3 + font.family: S.Theme.fontFamily } } @@ -212,7 +212,7 @@ Column { width: root.width - 16 height: 1 anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 + color: S.Theme.base03 visible: root.devices.length > 0 } @@ -238,9 +238,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.name - color: _isActive ? root.accentColor : M.Theme.base04 - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + color: _isActive ? root.accentColor : S.Theme.base04 + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily elide: Text.ElideRight width: parent.width - 80 } @@ -251,8 +251,8 @@ Column { anchors.verticalCenter: parent.verticalCenter text: modelData.celsius + "\u00B0C" color: root._tempColor(modelData.celsius) - font.pixelSize: M.Theme.fontSize - 2 - font.family: M.Theme.fontFamily + font.pixelSize: S.Theme.fontSize - 2 + font.family: S.Theme.fontFamily font.bold: _isActive } } diff --git a/shell/applets/VolumeApplet.qml b/shell/applets/VolumeApplet.qml index ac50847..4ffde00 100644 --- a/shell/applets/VolumeApplet.qml +++ b/shell/applets/VolumeApplet.qml @@ -1,6 +1,6 @@ import QtQuick import Quickshell.Services.Pipewire -import "../services" as M +import "../services" as S Column { id: root @@ -13,7 +13,7 @@ Column { property real volume: sink?.audio?.volume ?? 0 property bool muted: sink?.audio?.muted ?? false readonly property string volumeIcon: muted ? "\uF026" : (volume > 0.5 ? "\uF028" : (volume > 0 ? "\uF027" : "\uF026")) - readonly property color volumeColor: muted ? M.Theme.base04 : root.accentColor + readonly property color volumeColor: muted ? S.Theme.base04 : root.accentColor // Slider row Item { @@ -27,8 +27,8 @@ Column { anchors.verticalCenter: parent.verticalCenter text: root.volumeIcon color: root.volumeColor - font.pixelSize: M.Theme.fontSize + 2 - font.family: M.Theme.iconFontFamily + font.pixelSize: S.Theme.fontSize + 2 + font.family: S.Theme.iconFontFamily TapHandler { cursorShape: Qt.PointingHandCursor @@ -48,7 +48,7 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 3 } Rectangle { @@ -86,9 +86,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: Math.round(root.volume * 100) + "%" - color: root.muted ? M.Theme.base04 : M.Theme.base05 - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.fontFamily + color: root.muted ? S.Theme.base04 : S.Theme.base05 + font.pixelSize: S.Theme.fontSize + font.family: S.Theme.fontFamily width: 30 } } @@ -107,7 +107,7 @@ Column { width: parent.width - 16 height: 1 anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 + color: S.Theme.base03 } Text { @@ -117,8 +117,8 @@ Column { leftPadding: 12 text: "Output Devices" color: root.accentColor - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily } Repeater { @@ -136,8 +136,8 @@ Column { anchors.fill: parent anchors.leftMargin: 4 anchors.rightMargin: 4 - color: deviceHover.hovered ? M.Theme.base02 : "transparent" - radius: M.Theme.radius + color: deviceHover.hovered ? S.Theme.base02 : "transparent" + radius: S.Theme.radius } Text { @@ -147,9 +147,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: modelData.description || modelData.name || "Unknown" - color: parent._active ? root.accentColor : M.Theme.base05 - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.fontFamily + color: parent._active ? root.accentColor : S.Theme.base05 + font.pixelSize: S.Theme.fontSize + font.family: S.Theme.fontFamily font.bold: parent._active elide: Text.ElideRight } @@ -172,7 +172,7 @@ Column { width: parent.width - 16 height: visible ? 1 : 0 anchors.horizontalCenter: parent.horizontalCenter - color: M.Theme.base03 + color: S.Theme.base03 } Text { @@ -183,8 +183,8 @@ Column { leftPadding: 12 text: "Applications" color: root.accentColor - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily } Repeater { @@ -207,9 +207,9 @@ Column { anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: streamEntry._muted ? "\uF026" : "\uF028" - color: streamEntry._muted ? M.Theme.base04 : M.Theme.base05 - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.iconFontFamily + color: streamEntry._muted ? S.Theme.base04 : S.Theme.base05 + font.pixelSize: S.Theme.fontSize + font.family: S.Theme.iconFontFamily TapHandler { cursorShape: Qt.PointingHandCursor @@ -224,9 +224,9 @@ Column { anchors.leftMargin: 6 anchors.verticalCenter: parent.verticalCenter text: streamEntry._appName - color: M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + color: S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily elide: Text.ElideRight width: 70 } @@ -242,13 +242,13 @@ Column { Rectangle { anchors.fill: parent - color: M.Theme.base02 + color: S.Theme.base02 radius: 2 } Rectangle { width: parent.width * Math.min(1, Math.max(0, streamEntry._vol)) height: parent.height - color: streamEntry._muted ? M.Theme.base04 : root.accentColor + color: streamEntry._muted ? S.Theme.base04 : root.accentColor radius: 2 } @@ -275,9 +275,9 @@ Column { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: Math.round(streamEntry._vol * 100) + "%" - color: streamEntry._muted ? M.Theme.base04 : M.Theme.base05 - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + color: streamEntry._muted ? S.Theme.base04 : S.Theme.base05 + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily width: 28 } } diff --git a/shell/lock/Lock.qml b/shell/lock/Lock.qml index 1593850..d31ad0d 100644 --- a/shell/lock/Lock.qml +++ b/shell/lock/Lock.qml @@ -2,12 +2,12 @@ import QtQuick import Quickshell import Quickshell.Io import Quickshell.Wayland -import "../services" as M +import "../services" as S Scope { id: root - readonly property bool _enabled: M.Modules.lock.enable + readonly property bool _enabled: S.Modules.lock.enable property string _sessionPath: "" WlSessionLock { diff --git a/shell/lock/LockInput.qml b/shell/lock/LockInput.qml index 3c6b036..721e2e8 100644 --- a/shell/lock/LockInput.qml +++ b/shell/lock/LockInput.qml @@ -1,5 +1,5 @@ import QtQuick -import "../services" as M +import "../services" as S Item { id: root @@ -15,18 +15,18 @@ Item { anchors.fill: parent color: { if (root.state === "fail" || root.state === "error") - return Qt.rgba(M.Theme.base08.r, M.Theme.base08.g, M.Theme.base08.b, 0.15); + return Qt.rgba(S.Theme.base08.r, S.Theme.base08.g, S.Theme.base08.b, 0.15); if (root.state === "busy") - return Qt.rgba(M.Theme.base0D.r, M.Theme.base0D.g, M.Theme.base0D.b, 0.1); - return M.Theme.base02; + return Qt.rgba(S.Theme.base0D.r, S.Theme.base0D.g, S.Theme.base0D.b, 0.1); + return S.Theme.base02; } radius: height / 2 border.color: { if (root.state === "fail" || root.state === "error") - return M.Theme.base08; + return S.Theme.base08; if (root.state === "busy") - return M.Theme.base0D; - return M.Theme.base03; + return S.Theme.base0D; + return S.Theme.base03; } border.width: 1 @@ -52,9 +52,9 @@ Item { return "Too many attempts"; return "Enter password"; } - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize + font.family: S.Theme.fontFamily opacity: root.buffer.length === 0 ? 1 : 0 Behavior on opacity { @@ -78,7 +78,7 @@ Item { width: 10 height: 10 radius: 5 - color: M.Theme.base05 + color: S.Theme.base05 scale: 0 opacity: 0 diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index 7b245d8..9001d17 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -4,7 +4,7 @@ import Quickshell import Quickshell.Wayland import Quickshell.Services.Mpris import Quickshell.Services.Pipewire -import "../services" as M +import "../services" as S import "../applets" as C WlSessionLockSurface { @@ -13,7 +13,7 @@ WlSessionLockSurface { required property WlSessionLock lock required property LockAuth auth - color: M.Theme.base00 + color: S.Theme.base00 property real _bgOpacity: 0 NumberAnimation on _bgOpacity { @@ -27,7 +27,7 @@ WlSessionLockSurface { anchors.fill: parent captureSource: root.screen opacity: root._bgOpacity - visible: M.Modules.lock.screenshot ?? true + visible: S.Modules.lock.screenshot ?? true layer.enabled: true layer.effect: MultiEffect { @@ -41,7 +41,7 @@ WlSessionLockSurface { // Dim overlay Rectangle { anchors.fill: parent - color: Qt.rgba(M.Theme.base00.r, M.Theme.base00.g, M.Theme.base00.b, 0.4) + color: Qt.rgba(S.Theme.base00.r, S.Theme.base00.g, S.Theme.base00.b, 0.4) opacity: root._bgOpacity } @@ -112,9 +112,9 @@ WlSessionLockSurface { Text { anchors.horizontalCenter: parent.horizontalCenter text: Qt.formatTime(new Date(), "HH:mm") - color: M.Theme.base05 + color: S.Theme.base05 font.pixelSize: 72 - font.family: M.Theme.fontFamily + font.family: S.Theme.fontFamily font.bold: true Timer { @@ -129,9 +129,9 @@ WlSessionLockSurface { Text { anchors.horizontalCenter: parent.horizontalCenter text: Qt.formatDate(new Date(), "dddd, d MMMM") - color: M.Theme.base04 - font.pixelSize: M.Theme.fontSize + 2 - font.family: M.Theme.fontFamily + color: S.Theme.base04 + font.pixelSize: S.Theme.fontSize + 2 + font.family: S.Theme.fontFamily Timer { interval: 60000 @@ -160,9 +160,9 @@ WlSessionLockSurface { id: _errorText anchors.horizontalCenter: parent.horizontalCenter text: root.auth.message - color: M.Theme.base08 - font.pixelSize: M.Theme.fontSize - 1 - font.family: M.Theme.fontFamily + color: S.Theme.base08 + font.pixelSize: S.Theme.fontSize - 1 + font.family: S.Theme.fontFamily opacity: root.auth.message ? 1 : 0 height: root.auth.message ? implicitHeight : 0 @@ -192,11 +192,11 @@ WlSessionLockSurface { anchors.horizontalCenter: parent.horizontalCenter width: 280 height: _mprisContent.implicitHeight + 16 - radius: M.Theme.radius + 2 - color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7) - border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3) + radius: S.Theme.radius + 2 + color: Qt.rgba(S.Theme.base01.r, S.Theme.base01.g, S.Theme.base01.b, 0.7) + border.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3) border.width: 1 - visible: (M.Modules.lock.mpris ?? true) && _mprisPlayer !== null + visible: (S.Modules.lock.mpris ?? true) && _mprisPlayer !== null readonly property var _mprisPlayers: (Mpris.players.values ?? []).filter(p => p.trackTitle || p.playbackState === MprisPlaybackState.Playing || p.playbackState === MprisPlaybackState.Paused) readonly property var _mprisPlayer: _mprisPlayers[0] ?? null @@ -211,7 +211,7 @@ WlSessionLockSurface { player: _mprisCard._mprisPlayer players: _mprisCard._mprisPlayers playing: _mprisCard._playing - accentColor: M.Theme.base0D + accentColor: S.Theme.base0D cachedArt: _mprisCard._mprisPlayer?.trackArtUrl ?? "" } } @@ -222,11 +222,11 @@ WlSessionLockSurface { anchors.horizontalCenter: parent.horizontalCenter width: 280 height: _volumeContent.implicitHeight + 16 - radius: M.Theme.radius + 2 - color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7) - border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3) + radius: S.Theme.radius + 2 + color: Qt.rgba(S.Theme.base01.r, S.Theme.base01.g, S.Theme.base01.b, 0.7) + border.color: Qt.rgba(S.Theme.base03.r, S.Theme.base03.g, S.Theme.base03.b, 0.3) border.width: 1 - visible: (M.Modules.lock.volume ?? true) && Pipewire.defaultAudioSink !== null + visible: (S.Modules.lock.volume ?? true) && Pipewire.defaultAudioSink !== null PwObjectTracker { objects: [Pipewire.defaultAudioSink] @@ -241,7 +241,7 @@ WlSessionLockSurface { sink: Pipewire.defaultAudioSink sinkList: [] streamList: [] - accentColor: M.Theme.base0E + accentColor: S.Theme.base0E } } } @@ -354,8 +354,8 @@ WlSessionLockSurface { // so the bar's ScreenCorners aren't visible. Draw our own. component LockCorner: Canvas { property int corner: 0 - readonly property int _r: M.Theme.screenRadius - visible: _r > 0 && M.Modules.screenCorners.enable + readonly property int _r: S.Theme.screenRadius + visible: _r > 0 && S.Modules.screenCorners.enable width: _r height: _r z: 999