Skip to content

Proposed Background Opacity Setting for cpuload - #1881

Merged
rcalixte merged 10 commits into
linuxmint:masterfrom
EvilSupahFly:master
Aug 9, 2026
Merged

Proposed Background Opacity Setting for cpuload#1881
rcalixte merged 10 commits into
linuxmint:masterfrom
EvilSupahFly:master

Conversation

@EvilSupahFly

Copy link
Copy Markdown
Contributor

What I added:

  1. A new desklet-background-color entry in settings-schema.json, using the same colorchooser widget type your font-color and static-theme-color settings already use. That widget's picker has an alpha slider built in, so one control sets both colour and transparency - no separate opacity slider needed. Default is rgba(0,0,0,0) (fully transparent), so existing users see no change until they pick a colour.
  2. A refreshBackground() method in desklet.js that sets this.content.style = "background-color: " + this.desklet_background_color + ";" which is same pattern the original code already used for font-color in getTextLabelStyle().
  3. Wired it to run once at startup and again whenever settings change (on_setting_changed), so picking a new colour updates in real time.
  4. I also gave show-background a clearer label ("Show gauge track") and a tooltip, since it's easy to confuse with the new setting.

Translation files have not been touched as I'm only fluent in English.

What I added:
1. A new `desklet-background-color` entry in `settings-schema.json`, using the same `colorchooser` widget type your `font-color` and `static-theme-color` settings already use. That widget's picker has an alpha slider built in, so one control gives you both color *and* transparency - no separate opacity slider needed. Default is `rgba(0,0,0,0)` (fully transparent), so existing users see no change until they pick a color.
2. A `refreshBackground()` method in `desklet.js` that sets `this.content.style = "background-color: " + this.desklet_background_color + ";"` which is same pattern the original code already used for `font-color` in `getTextLabelStyle()`.
3. Wired it to run once at startup and again whenever settings change (`on_setting_changed`), so picking a new color updates in real time.
4. I also gave `show-background` a clearer label ("Show gauge track") and a tooltip, since it's easy to confuse with the new setting.

You can see all the changes in [`desklet-background-color.patch`](https://github.com/EvilSupahFly/cpu-load/blob/main/desklet-background-color.patch).
@EvilSupahFly
EvilSupahFly marked this pull request as draft August 1, 2026 06:17
@EvilSupahFly
EvilSupahFly marked this pull request as ready for review August 1, 2026 06:19
@claudiux

claudiux commented Aug 5, 2026

Copy link
Copy Markdown
Member

Ping @schorschii

@schorschii

Copy link
Copy Markdown
Contributor

Looks good, thanks. Before merging, please:

  • remove the .patch file
  • remove the newly added README.md and it's screenshots (I don't know where it would be shown - there is already a README.md with a screenshot in the root folder cpuload@kimse which is shown on https://cinnamon-spices.linuxmint.com/)

@EvilSupahFly

Copy link
Copy Markdown
Contributor Author

Ping @schorschii

@schorschii

Copy link
Copy Markdown
Contributor

Looks good now!

@rcalixte
rcalixte merged commit 7bbbef3 into linuxmint:master Aug 9, 2026
4 checks passed
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.

4 participants