-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Documentation request: how to use current system accent colour in custom components? #118
Comments
This seems specific to Gala, so probably not something that really fits in the docs for app developers. For GTK apps, accent colors "just work" Since Gala doesn't use GTK, it relies on the foreign drawing API to get accent color information. There's a utility function to get a Gdk.RGBA for this here: https://github.com/elementary/gala/blob/87d51c50fbd5a28d2d0d6c3872b4e15e39c9131a/src/InternalUtils.vala#L344 |
There's also the case of needing to build a custom widget for something. I was having a play around with something where I wanted to draw an audio waveform derived from a GTK DrawingArea recently, and found it was a nice touch to draw it in the user's accent colour. So that's at least a use case outside of Gala. |
@danrabbit Thanks for the link, will check it out. Also, regarding the non-Gala use case, what @davidmhewitt said (that’s why I specifically put “in custom components” in the title, as I could see myself wanting to do just that outside of my current use case) :) |
@danrabbit It looks like I can’t access InternalUtils although it looks like a public class and the method looks like public static method. I’m getting:
(Assuming it’s somehow otherwise hidden. Would make sense for a class called InternalUtils, I guess.) Anyway, I’m way out of my depth here. Will probably have to return to this once I have time to really dig into Vala and platform internals :) |
Im wondering to how one would to such a thing |
Problem
The documentation page on colour scheme doesn’t currently have information on how to make use of the person’s chosen access colour.
Proposal
Add documentation on how to use accent colours to the colour scheme page.
Prior Art
n/a
What led to this request
I’m trying to get the colour set as the system accent colour to use in a gala plugin.
I tried accessing it via Granite.Settings but I get:
(
granite_settings
isGranite.Settings.get_default()
)The text was updated successfully, but these errors were encountered: