-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get accent color from system stylesheet #360
Comments
Hi Daniel, Thank you very much for your report! Yes, that is something that is definitely in my wish-list and a must have for elementary OS 6. Do you know if there is another way of getting it? A GSetting maybe? Otherwise, I could just generate a elementary OS build with a #ifdef 🤔 |
Hm not reliably. I guess you could try to read /org/gnome/desktop/interface/gtk-theme and guess from a set of hardcoded colors, but this solution would work for any Gtk desktop and stylesheet |
I finally decided to use GTK to get both the background color and the border color. Reading the current theme and using a hardcoded color was just too hacky and difficult to maintain: I don't have access to elementary OS 6, so I can not test it with the new accent color selector. It should wok ™️ but it will be nice to test it before I release v2.0.3. Could you confirm it please? BTW, does Gala on elementary OS 6 add a border to the tiling preview? I didn't find a reference to For those who prefer to not install GTK and/or leave some RAM unused (this feature increases RAM usage from 800kb to ~5MB, but c'mon guys, this flies on a Raspberry Pi 4), I added a flag to NOT compile with GTK: |
I can confirm that the correct accent color is loaded on session start, but it doesn't seem to update during the session if the user changes their accent color I don't believe we do add a border for tiling previews Also, I added you to the allowlist for builds.elementary.io :) |
Weird, I calculate the new color just before every animated gesture... Thank you so much for giving me access, I'll do some testing 😄 |
You can use Gtk foreign drawing API to get the correct accent color from the stylesheet. Consider this commit in Gala:
https://github.com/elementary/gala/pull/909/files#diff-7621626af936a6bd469f8302ec5666ca88e146bb87af769b507a010f30ee55d3R398
The text was updated successfully, but these errors were encountered: