qmlformat + fix build

This commit is contained in:
quadbyte 2025-08-10 11:59:54 -04:00
parent 2ed3488453
commit 61abcddeeb
9 changed files with 140 additions and 130 deletions

View file

@ -8,7 +8,8 @@ Variants {
PanelWindow { PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Qt.resolvedUrl("../../Assets/Tests/wallpaper.png") property string wallpaperSource: Qt.resolvedUrl(
"../../Assets/Tests/wallpaper.png")
visible: wallpaperSource !== "" visible: wallpaperSource !== ""
color: "transparent" color: "transparent"
@ -37,7 +38,5 @@ Variants {
smooth: true smooth: true
mipmap: false mipmap: false
} }
} }
} }

View file

@ -9,7 +9,8 @@ Variants {
PanelWindow { PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Qt.resolvedUrl("../../Assets/Tests/wallpaper.png") property string wallpaperSource: Qt.resolvedUrl(
"../../Assets/Tests/wallpaper.png")
visible: wallpaperSource !== "" visible: wallpaperSource !== ""
color: "transparent" color: "transparent"
@ -49,9 +50,8 @@ Variants {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(Colors.backgroundPrimary.r, Colors.backgroundPrimary.g, Colors.backgroundPrimary.b, 0.5) color: Qt.rgba(Colors.backgroundPrimary.r, Colors.backgroundPrimary.g,
Colors.backgroundPrimary.b, 0.5)
} }
} }
} }

View file

@ -67,36 +67,37 @@ NLoader {
antialiasing: true antialiasing: true
renderTarget: Canvas.FramebufferObject renderTarget: Canvas.FramebufferObject
onPaint: function () { onPaint: function () {
const ctx = getContext("2d"); const ctx = getContext("2d")
ctx.reset(); ctx.reset()
ctx.clearRect(0, 0, width, height); ctx.clearRect(0, 0, width, height)
// Solid white base (alpha=1) // Solid white base (alpha=1)
ctx.globalCompositeOperation = "source-over"; ctx.globalCompositeOperation = "source-over"
ctx.fillStyle = "#ffffffff"; ctx.fillStyle = "#ffffffff"
ctx.fillRect(0, 0, width, height); ctx.fillRect(0, 0, width, height)
// Punch hole using destination-out with rounded rect path // Punch hole using destination-out with rounded rect path
const x = Math.round(root.borderWidth / 2); const x = Math.round(root.borderWidth / 2)
const y = Math.round(root.borderWidth / 2); const y = Math.round(root.borderWidth / 2)
const w = Math.max(0, width - root.borderWidth); const w = Math.max(0, width - root.borderWidth)
const h = Math.max(0, height - root.borderWidth); const h = Math.max(0, height - root.borderWidth)
const r = Math.max(0, Math.min(root.innerRadius, Math.min(w, h) / 2)); const r = Math.max(0, Math.min(root.innerRadius,
Math.min(w, h) / 2))
ctx.globalCompositeOperation = "destination-out"; ctx.globalCompositeOperation = "destination-out"
ctx.fillStyle = "#ffffffff"; ctx.fillStyle = "#ffffffff"
ctx.beginPath(); ctx.beginPath()
// rounded rectangle path using arcTo // rounded rectangle path using arcTo
ctx.moveTo(x + r, y); ctx.moveTo(x + r, y)
ctx.lineTo(x + w - r, y); ctx.lineTo(x + w - r, y)
ctx.arcTo(x + w, y, x + w, y + r, r); ctx.arcTo(x + w, y, x + w, y + r, r)
ctx.lineTo(x + w, y + h - r); ctx.lineTo(x + w, y + h - r)
ctx.arcTo(x + w, y + h, x + w - r, y + h, r); ctx.arcTo(x + w, y + h, x + w - r, y + h, r)
ctx.lineTo(x + r, y + h); ctx.lineTo(x + r, y + h)
ctx.arcTo(x, y + h, x, y + h - r, r); ctx.arcTo(x, y + h, x, y + h - r, r)
ctx.lineTo(x, y + r); ctx.lineTo(x, y + r)
ctx.arcTo(x, y, x + r, y, r); ctx.arcTo(x, y, x + r, y, r)
ctx.closePath(); ctx.closePath()
ctx.fill(); ctx.fill()
} }
onWidthChanged: requestPaint() onWidthChanged: requestPaint()
onHeightChanged: requestPaint() onHeightChanged: requestPaint()
@ -105,9 +106,13 @@ NLoader {
// Repaint mask when properties change // Repaint mask when properties change
Connections { Connections {
target: root target: root
function onBorderWidthChanged() { maskSource.requestPaint() } function onBorderWidthChanged() {
maskSource.requestPaint()
}
function onRingColorChanged() {/* no-op for mask */ } function onRingColorChanged() {/* no-op for mask */ }
function onInnerRadiusChanged() { maskSource.requestPaint() } function onInnerRadiusChanged() {
maskSource.requestPaint()
}
} }
// Texture for maskSource; hides the original // Texture for maskSource; hides the original
@ -133,4 +138,3 @@ NLoader {
} }
} }
} }

View file

@ -0,0 +1,10 @@
import Quickshell
import qs.Modules.Bar
Variants {
model: Quickshell.screens
delegate: Bar {
modelData: item
}
}

View file

@ -32,7 +32,6 @@ Singleton {
// Qt.callLater(function () { // Qt.callLater(function () {
// WallpaperManager.setCurrentWallpaper(settings.currentWallpaper, true); // WallpaperManager.setCurrentWallpaper(settings.currentWallpaper, true);
// }) // })
id: settingFileView id: settingFileView
path: settingsFile path: settingsFile

View file

@ -69,8 +69,7 @@ Singleton {
if (Settings.data.wallpaper.isRandom && !randomWallpaperTimer.running) { if (Settings.data.wallpaper.isRandom && !randomWallpaperTimer.running) {
randomWallpaperTimer.start() randomWallpaperTimer.start()
setRandomWallpaper() setRandomWallpaper()
} else if (!Settings.data.randomWallpaper } else if (!Settings.data.randomWallpaper && randomWallpaperTimer.running) {
&& randomWallpaperTimer.running) {
randomWallpaperTimer.stop() randomWallpaperTimer.stop()
} }
} }

View file

@ -20,11 +20,13 @@ PanelWindow {
function show() { function show() {
// Ensure only one panel is visible at a time using Settings as ephemeral store // Ensure only one panel is visible at a time using Settings as ephemeral store
try { try {
if (Settings.openPanel && Settings.openPanel !== outerPanel && Settings.openPanel.hide) { if (Settings.openPanel && Settings.openPanel !== outerPanel
&& Settings.openPanel.hide) {
Settings.openPanel.hide() Settings.openPanel.hide()
} }
Settings.openPanel = outerPanel Settings.openPanel = outerPanel
} catch (e) { } catch (e) {
// ignore // ignore
} }
visible = true visible = true
@ -56,13 +58,19 @@ PanelWindow {
Component.onDestruction: { Component.onDestruction: {
try { try {
if (visible && Settings.openPanel === outerPanel) Settings.openPanel = null if (visible && Settings.openPanel === outerPanel)
} catch (e) {} Settings.openPanel = null
} catch (e) {
}
} }
onVisibleChanged: function () { onVisibleChanged: function () {
try { try {
if (!visible && Settings.openPanel === outerPanel) Settings.openPanel = null if (!visible && Settings.openPanel === outerPanel)
} catch (e) {} Settings.openPanel = null
} catch (e) {
}
} }
} }

View file

@ -1,6 +1,6 @@
// Disable reload popup // Disable reload popup
//@ pragma Env QS_NO_RELOAD_POPUP=1 //@ pragma Env QS_NO_RELOAD_POPUP=1
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
@ -15,19 +15,10 @@ import qs.Services
ShellRoot { ShellRoot {
id: root id: root
Variants {
model: Quickshell.screens
delegate: Bar {
modelData: item
}
}
Background {} Background {}
Overview {} Overview {}
ScreenCorners {}
ScreenCorner {} Bars {}
DemoPanel { DemoPanel {
id: demoPanel id: demoPanel