Proposed Background Opacity Setting for cpuload - #1881
Merged
Conversation
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
marked this pull request as draft
August 1, 2026 06:17
EvilSupahFly
marked this pull request as ready for review
August 1, 2026 06:19
Member
|
Ping @schorschii |
Contributor
|
Looks good, thanks. Before merging, please:
|
Contributor
Author
|
Ping @schorschii |
Contributor
|
Looks good now! |
claudiux
approved these changes
Aug 9, 2026
rcalixte
approved these changes
Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I added:
desklet-background-colorentry insettings-schema.json, using the samecolorchooserwidget type yourfont-colorandstatic-theme-colorsettings 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 isrgba(0,0,0,0)(fully transparent), so existing users see no change until they pick a colour.refreshBackground()method indesklet.jsthat setsthis.content.style = "background-color: " + this.desklet_background_color + ";"which is same pattern the original code already used forfont-coloringetTextLabelStyle().on_setting_changed), so picking a new colour updates in real time.show-backgrounda 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.