working colorscheme switcher

This commit is contained in:
lucy 2026-09-10 22:43:20 +02:00
commit 20b8012b78
335 changed files with 5914 additions and 36 deletions

View file

@ -1,22 +1,24 @@
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Widgets
import QtQuick
import QtQuick.Layouts
import qs
import qs.settings
import qs.widgets
import qs.modules.Services
FloatingWindow {
Rectangle {
id: child
implicitWidth: 800
implicitHeight: 600
visible: Config.cfg.themeSwitcherVisible
color: Colors.base00
title: "qs-themepicker"
onClosed: Config.cfg.themeSwitcherVisible = false
color: Colors.base01
radius: Config.cfg.appearance.rounding
MouseArea {
acceptedButtons: Qt.AllButtons
anchors.fill: parent
}
Process {
id: getSchemes
property list<string> schemes
@ -29,15 +31,16 @@ FloatingWindow {
}
}
Rectangle {
anchors.fill: child.contentItem
anchors.centerIn: child.contentItem
anchors.fill: parent
anchors.centerIn: parent
anchors.margins: 10
radius: Config.cfg.appearance.rounding / 1.5
radius: Config.cfg.appearance.rounding
color: Colors.base01
clip: true
RowLayout {
id: contentLayout
anchors.fill: parent
anchors.margins: 30
ListView {
id: schemeList
spacing: 5

View file

@ -20,8 +20,7 @@ BarComponent {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
Config.cfg.themeSwitcherVisible = true
WidgetTracker.toggle("colors", parent.barScreen)
}
}
ThemeSwitcher {}
}

View file

@ -6,7 +6,7 @@ IpcHandler {
id: handler
target: "config"
function reload() {
Quickshell.reload(true);
Quickshell.reload(false);
}
function openPicker() {
WidgetTracker.toggle("colorschemes", null)

View file

@ -39,6 +39,16 @@ Variants {
WidgetTracker.close();
event.accepted = true;
}
ThemeSwitcher {
z: 1
anchors.centerIn: parent
visible: persist.shown
PersistentProperties {
id: persist
reloadableId: "visible"
property bool shown: root?.shown && WidgetTracker?.current === "colors"
}
}
VolPopup {
id: volPopup
z: 1