Skip to content

feat(ui): add configurable font colour with UI theme fallback#9

Open
BorisKonstantinov wants to merge 1 commit into
zayronxio:mainfrom
BorisKonstantinov:textColour
Open

feat(ui): add configurable font colour with UI theme fallback#9
BorisKonstantinov wants to merge 1 commit into
zayronxio:mainfrom
BorisKonstantinov:textColour

Conversation

@BorisKonstantinov
Copy link
Copy Markdown

@BorisKonstantinov BorisKonstantinov commented Feb 20, 2026

Heya!

My UI theme settings made it so the app was placing a dark font colour onto my dark taskbars, so Iv implemented the option to change from the UI-matching default to any html colour. Iv made it to change not just the compact representation but the full one as well, as I thought someone might like to have a fancy colour in their setup. More technical notes below. This is fully backward compatible, users who don't touch the setting will never notice a change.

Changes

  contents/config/main.xml
  Two new config entries are added to the General group:
  - fontColourMode (int, default 0) — tracks whether the user has selected UI Theme (0) or Custom (1)
  - fontColour (string, default "") — stores the user-supplied HTML colour value

  contents/ui/GeneralConfig.qml
  A new Font Colour section is appended to the settings form, following the existing field conventions:
  - A ComboBox presenting "UI Theme" and "Custom" options, wired through a QtObject to persist the
  selection
  - A TextField that appears only when "Custom" is selected, with a placeholderText of #ffffff to
  communicate the expected input format. Width matches the existing Latitude/Longitude fields.

  contents/ui/CompactRepresentation.qml
  Three properties are added at the top of the item:
  property int fontColourMode: Plasmoid.configuration.fontColourMode
  property string fontColour: Plasmoid.configuration.fontColour
  readonly property color effectiveFontColour: (fontColourMode === 1 && fontColour !== "") ? fontColour :
   PlasmaCore.Theme.textColor
  All 5 labels (temperature value, unit suffix, and short weather description — in both horizontal and
  vertical panel orientations) are updated from PlasmaCore.Theme.textColor or no explicit colour to
  effectiveFontColour.

  contents/ui/FullRepresentation.qml
  The same three properties and resolution logic are added. A previously missing import
  org.kde.plasma.core as PlasmaCore is also added, which was required for the theme colour fallback. All
  6 labels in the expanded popup view are updated: current temperature, long weather description, rain
  probability, forecast day names, and forecast max/min temperatures. The existing opacity: .5 on the
  minimum temperature label is preserved.

Behaviour

  - With "UI Theme" selected (default), all labels behave exactly as before — no visual change for
  existing users.
  - With "Custom" selected and a valid HTML colour entered, all visible text across both the compact
  panel view and the expanded popup adopts that colour reactively, without requiring a widget restart.
  - If "Custom" is selected but the field is left empty, the widget silently falls back to the theme
  colour.

@Nicolas-Gth
Copy link
Copy Markdown

Oh, I guess this would fix #10 (comment)

@BorisKonstantinov
Copy link
Copy Markdown
Author

@Nicolas-Gth Do you know if I can tag the issue in my commit?

@Nicolas-Gth
Copy link
Copy Markdown

I think only the owner of the repo can do that

@xcurx
Copy link
Copy Markdown

xcurx commented Mar 22, 2026

I hope this will be merged soon

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.

3 participants