Add per-area color preference sliders
Five grayscale (black->white) sliders in Preferences that update live:
outer-chrome background (QPalette.Window), the rounded transport button
boxes, the now-playing panel, the now-playing text, and the row stripes
(QPalette.AlternateBase). Defaults are None ("inherit current") so nothing
changes until the user drags. Decouples the button boxes from the stripe
color (they used to share palette alternate-base). Live preview via
Preferences.set_live (no disk write); persisted ~0.4s after the drag.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+16
-1
@@ -9,8 +9,16 @@ DEFAULTS = {
|
||||
"ui_scale": "medium", # small | medium | large
|
||||
"highlight": "blue", # see theme.HIGHLIGHT_COLORS
|
||||
"now_playing_font": None, # None=prefer Century Gothic, ""=use app
|
||||
# default, "Family"=user-chosen substitute
|
||||
# default, "Family"=use app
|
||||
"volume": 0.8, # logical 0..1 master output volume
|
||||
# Per-area grayscale overrides (0=black .. 255=white). None = inherit the
|
||||
# current/default look for that surface, so nothing changes until the user
|
||||
# drags a slider in Preferences.
|
||||
"color_background": None, # outer chrome (QPalette.Window)
|
||||
"color_button": None, # rounded transport button boxes
|
||||
"color_now_playing_bg": None, # panel behind the now-playing text
|
||||
"color_now_playing_text": None, # the now-playing title/artist text
|
||||
"color_stripe": None, # alternating row stripes (QPalette.AlternateBase)
|
||||
"lastfm": {
|
||||
"api_key": "",
|
||||
"api_secret": "",
|
||||
@@ -49,6 +57,13 @@ class Preferences(QObject):
|
||||
self.save()
|
||||
self.changed.emit()
|
||||
|
||||
def set_live(self, key: str, value):
|
||||
"""Update a preference and notify listeners *without* writing to disk —
|
||||
for live drag-preview (e.g. the color sliders). Call save() to persist
|
||||
once the user stops dragging."""
|
||||
self._data[key] = value
|
||||
self.changed.emit()
|
||||
|
||||
def update_lastfm(self, **fields):
|
||||
self._data["lastfm"].update(fields)
|
||||
self.save()
|
||||
|
||||
Reference in New Issue
Block a user