aboutsummaryrefslogtreecommitdiffstats
path: root/appearance/Tab.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-11 18:30:58 +0200
committerDanilo M. <danix@danix.xyz>2026-09-11 18:30:58 +0200
commit1b252e32d93e1e0207d2a69ee3445e1dbf6505ae (patch)
treed4280dae5cab886898e7e5e674508728e2d5150a /appearance/Tab.qml
parent43c31deaa313a8e471ecc3b5a55411a3b93b6f08 (diff)
downloadquickshell-1b252e32d93e1e0207d2a69ee3445e1dbf6505ae.tar.gz
quickshell-1b252e32d93e1e0207d2a69ee3445e1dbf6505ae.zip
feat(appearance): wallpaper picker and scheme switcher
One drawer for how the desktop looks, on SUPER+Return, replacing the qarma file dialog that key used to open. wallp is untouched and still does the work: the panel calls it with H= and V= and it still runs from a terminal. Clicking a thumbnail stages it rather than setting it, so both screens can be composed before anything changes and Apply is a single wallp call. The mock screens show the result: the staged pick where there is one, what is set where there is not, and the hovered thumbnail on the targeted screen. They are drawn at the real proportions from hyprctl monitors, DP-3 upright because it has transform=1, centred against each other as Hyprland has them. The scheme tab reads the palette pair unified-desktop-theme keeps for each scheme, so the swatches are that scheme's real colours and the list needs no edit when a scheme is added. Applying writes roles.conf and runs install.sh, and reloads nothing, because install.sh reloads nothing: the panel says what is still showing the old scheme rather than pretending the switch is done. Two QML traps are documented in AGENTS.md because neither announces itself: there is no String.matchAll, which threw inside a try and left every swatch empty, and assigning running = true to an already-running Process does nothing, which stopped the scheme loader after the first file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7NRsGyF9jGfPYS4zPqpN7
Diffstat (limited to 'appearance/Tab.qml')
-rw-r--r--appearance/Tab.qml45
1 files changed, 45 insertions, 0 deletions
diff --git a/appearance/Tab.qml b/appearance/Tab.qml
new file mode 100644
index 0000000..bb2d210
--- /dev/null
+++ b/appearance/Tab.qml
@@ -0,0 +1,45 @@
+// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+import QtQuick
+
+Rectangle {
+ id: tab
+ property alias text: label.text
+ property bool selected: false
+ property bool enabled: true
+ signal clicked
+
+ implicitWidth: label.implicitWidth + 24
+ implicitHeight: label.implicitHeight + 14
+ radius: 7
+ opacity: enabled ? 1 : 0.4
+ color: selected ? Qt.alpha(Theme.accent, 0.25)
+ : area.containsMouse ? Qt.alpha(Theme.surface, 0.8)
+ : Qt.alpha(Theme.surface, 0.35)
+ border.width: 1
+ border.color: selected ? Qt.alpha(Theme.accent, 0.5) : "transparent"
+
+ Text {
+ id: label
+ anchors.centerIn: parent
+ font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 }
+ color: tab.selected ? Theme.text : Theme.subtext
+ }
+
+ MouseArea {
+ id: area
+ anchors.fill: parent
+ hoverEnabled: true
+ cursorShape: tab.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
+ onClicked: if (tab.enabled) tab.clicked()
+ }
+}