Re: Custom GtkHeaderBar
- From: cecashon aol com
- To: tfujiwar redhat com, gtk-app-devel-list gnome org
- Subject: Re: Custom GtkHeaderBar
- Date: Mon, 17 Apr 2017 13:52:39 -0400
If I use
gtk_style_context_add_class(context, "header");
The background drawn to the event box window is transparent on my computer. I just used "menu" to test a
different color from the theme but there are many that you can test. The style classes are at the bottom of
the documentation page.
https://developer.gnome.org/gtk3/stable/GtkStyleContext.html
I painted the main window green so that I could see if the event box window gets drawn to and also to
distinguish widgets that don't have windows like the GtkLabel, GtkBox and GtkGrid.
Another option is to have a CSS file for the header widget and use that although then you get away from using
the users theme. I have tried using the deprecated function
gtk_style_context_get_background_color()
to peak at if there is a constant background color set and what it might be but that function isn't going to
work for a gradient or image so it is only a partial solution for checking the style class background.
Still trying to figure out these things myself.
Eric
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]