PyGObject: ask for system/theme colors

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PyGObject: ask for system/theme colors

Gtk+ - Apps Dev mailing list
I don't want to use colors defined by myself e.g. with RGB-values.
I want to use colors from the system (Windows, Linux, ...) and/or the
theme.

For example I need the background color of a highlighted menu or list
item.

Is there a way?

Can I also ask for fonts like this?
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: PyGObject: ask for system/theme colors

Gtk+ - Apps Dev mailing list
Op 14-09-18 om 23:19 schreef c.buhtz--- via gtk-app-devel-list:
> I don't want to use colors defined by myself e.g. with RGB-values.
> I want to use colors from the system (Windows, Linux, ...) and/or the
> theme.
>
> For example I need the background color of a highlighted menu or list
> item.
>
> Is there a way?

There is but it is pretty much impossible to do the correct thing with
them. See my reply on your other question about the drag icon what you
should use.

If you want to explore what you do is get a Gtk.StyleContext from a
Gtk.Widget with Gtk.Widget.get_style_context(). It hold the information
you are looking for like font and colour information. You retrieve them
with Gtk.StyleContext.get_property() with a Gtk.STYLE_PROPERTY_*
property and Gtk.StateFlags.*.

~infirit
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list