Skip to content

Use SystemPalette for dynamic theme-aware text colors#23

Open
citizenserious wants to merge 3 commits intoPrayag2:mainfrom
citizenserious:theme-aware
Open

Use SystemPalette for dynamic theme-aware text colors#23
citizenserious wants to merge 3 commits intoPrayag2:mainfrom
citizenserious:theme-aware

Conversation

@citizenserious
Copy link
Copy Markdown

Summary

This PR adds optional support for using the current system/Plasma theme text color for the clock labels.

Previously, day, date, and time text relied only on manually configured colors. This could make the widget unreadable when switching between light and dark Plasma themes.

Changes

  • add a new follow_system_text_color config option
  • expose the option in the appearance settings
  • disable manual color pickers while the option is enabled
  • use SystemPalette.windowText for day, date, and time when the option is enabled
  • keep the existing manual color behavior when the option is disabled

Why this approach

Other theme-color approaches did not behave correctly during testing on Fedora 43 / KDE Plasma 6.6.3.
SystemPalette.windowText correctly followed live Plasma light/dark theme changes in actual use.

Result

With this change:

  • the widget can automatically follow the active Plasma theme text color
  • manual color selection still works as before when theme-following is disabled

Fixes

Fixes #14

Replace the static text color handling for day, date, and time with a
theme-aware fallback based on SystemPalette.

When follow_system_text_color is enabled, the labels use
SystemPalette.windowText so the widget reacts correctly to Plasma
light/dark theme changes at runtime.

When the option is disabled, the existing manually configured text colors
remain in use.
Introduce a new boolean config entry named follow_system_text_color.

This setting controls whether the widget should use theme-provided text
colors or the manually configured label colors. The default is enabled so
the widget follows the active Plasma theme out of the box.
Add a new appearance setting that lets users switch between manual text
colors and automatic theme-based text colors.

Also disable the manual color pickers while the system text color option
is enabled, so the UI clearly reflects which color source is currently
active.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic theme change

1 participant