Files
Panama/config/dot/quickshell/accent-controls-harness.qml
T
Gabriel Brown cb7c09d208 Give the desktop real themes, video wallpapers, and honest titlebars
Appearance now opens on Themes: light and dark side by side, each
remembering its own choice, over galleries of ten shipped themes —
Tokyo Moon and Day joined by Moon Rose, Catppuccin, Nord, Gruvbox and
Everforest in both modes. A theme is a complete palette: the catalog
lives in themes.json, Theme.qml reads every color token from the
active record, and one render pipeline carries it to kitty, tmux,
btop, GTK, Vicinae, Firefox's chrome, and the lock screen. The Theme
editor builds new ones from four wells — wheel, hex, or eyedropper —
with derived surfaces, a saturation slider, debounced fine-tune, and
effects that save with the theme. Custom edits finally keep GNOME's
accent, kitty's border, and hyprlock in sync.

Wallpapers can be video: mpvpaper per output, hardware-decoded, muted
and looped, supervised and respawned. Panama owns the pausing — games,
battery, and a bar pill for right now — because the compositor
rebuilds full-screen blur for every frame a video wallpaper draws.
The lock screen gets a still frame.

Titlebars stop lying. GNOME apps get close-only on your chosen side,
the maximize and double-click settings are gone, the Settings window
obeys the same rules, and its titlebar can be turned off entirely.
Typography becomes five labeled dropdowns instead of a wall of
samples.

Contracts updated and written throughout (165 now); per the redesign
workflow none were executed — the full sweep runs once at the end.

Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
2026-08-23 23:39:04 -04:00

81 lines
2.9 KiB
QML

// Headless theme editor, for accent-controls-contract.
//
// The two halves of the editor that write colour: the four wells
// (ThemeEditorWells + ColorWell), which are the fast path and own hex
// validation and the eyedropper, and the six HSV rows (AccentEditor), which
// are the fine-tune behind a disclosure.
//
// AccentEditor commits on a debounce rather than per move, so `adjust` returns
// what is *pending*, not what is stored -- the caller waits and reads `status`
// again. That is the behaviour under test as much as the colour itself: a
// slider that wrote on every move spent a whole drag in apply-and-verify round
// trips and left the desktop repainting behind the pointer.
import Quickshell
import Quickshell.Io
import QtQuick
import qs.config
import qs.modules.settings
import qs.services
ShellRoot {
Item {
width: 680
height: wells.implicitHeight + editor.implicitHeight
ThemeEditorWells {
id: wells
width: parent.width
}
AccentEditor {
id: editor
y: wells.implicitHeight
width: parent.width
}
}
IpcHandler {
target: "accent-controls-test"
function status(): string {
return JSON.stringify({
id: ThemeProfiles.activeProfile.id,
name: ThemeProfiles.activeProfile.name,
scheme: ThemeProfiles.activeProfile.scheme,
accent: String(ThemeProfiles.activeProfile.accent),
secondary: String(ThemeProfiles.activeProfile.secondary),
shipped: ThemeProfiles.activeProfile.shipped === true,
accentName: String(DesktopPreferences.get("accentName")),
bg: String(ThemeProfiles.activePalette.bg),
fg: String(ThemeProfiles.activePalette.fg),
fgDim: String(ThemeProfiles.activePalette.fgDim),
pending: editor.pending !== null,
wellError: wells.lastError
});
}
// Moves one HSV slider. The commit is debounced, so the answer is the
// pair the sliders are showing, not the stored one.
function adjust(target: string, channel: string, ratio: real): string {
editor.changeChannel(target, channel, ratio);
return JSON.stringify({
shown: { accent: editor.shownAccent, secondary: editor.shownSecondary },
pending: editor.pending !== null,
stored: {
accent: String(ThemeProfiles.activeProfile.accent),
secondary: String(ThemeProfiles.activeProfile.secondary)
}
});
}
// The one path every well takes -- typed hex, colour wheel and
// eyedropper all end here, so validation cannot differ between them.
function well(which: string, hex: string): string {
wells.apply(which, hex);
return status();
}
}
}