Re: Custom GtkHeaderBar

2017-04-17 Thread Takao Fujiwara
On 04/18/17 02:52, cecas...@aol.com-san wrote: If I use gtk_style_context_add_class(context, "header"); As I replied, I fixed that problem to call this.get_style_context().remove_class("csd") after set_titlebar(header) is called. Fujiwara The background drawn to the event box window is t

Re: Custom GtkHeaderBar

2017-04-17 Thread Eric Cashon via gtk-app-devel-list
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

Re: Custom GtkHeaderBar

2017-04-16 Thread Takao Fujiwara
I think your example still draws the green color of the hbox but not the theme color of GtkHeaderBar. I also think the menu and headerbar's colors are different. Fujiwara On 04/16/17 04:25, cecas...@aol.com-san wrote: I gave it another try and "header" gtk_style_context_add_class() is transpa

Re: Custom GtkHeaderBar

2017-04-15 Thread Eric Cashon via gtk-app-devel-list
I gave it another try and "header" gtk_style_context_add_class() is transparent. I can use "menu" and that returns a darker color that is used on the title bar. It is C again. I did get foo.vala output to foo.c. Too much stuff. Eric /* gcc -Wall box1.c -o box1 `pkg-config --cflags --libs

Re: Custom GtkHeaderBar

2017-04-15 Thread Eric Cashon via gtk-app-devel-list
Well I made a mess of that. I haven't worked with Vala and thought that looked like C#. I have some time on the weekend so I will have to take a look at Vala and run your code so I understand it better. I can get the theme color with gtk_widget_get_style_context() if I have a GtkHeaderBar. If

Re: Custom GtkHeaderBar

2017-04-15 Thread Takao Fujiwara
On 04/15/17 04:36, cecas...@aol.com-san wrote: I suspect set_titlebar(header); is causing the problem. If you remove that, then you will have a box that you place in the main window. If it is a header bar box it will be below the titlebar. The box itself is just doing the layout so it uses th

Re: Custom GtkHeaderBar

2017-04-15 Thread Takao Fujiwara
On 04/16/17 00:05, Takao Fujiwara-san wrote: On 04/15/17 04:36, cecas...@aol.com-san wrote: A little limited here since I don't have a C# setup and am using GTK3.18 which doesn't have all the 3.22 functions. What OS are you using and how did you setup C# for programming with? Sorry, ignored t

Re: Custom GtkHeaderBar

2017-04-15 Thread Takao Fujiwara
On 04/15/17 04:36, cecas...@aol.com-san wrote: A little limited here since I don't have a C# setup and am using GTK3.18 which doesn't have all the 3.22 functions. What OS are you using and how did you setup C# for programming with? Sorry, ignored this question. Now I understood what you asked.

Re: Custom GtkHeaderBar

2017-04-14 Thread Eric Cashon via gtk-app-devel-list
I suspect set_titlebar(header); is causing the problem. If you remove that, then you will have a box that you place in the main window. If it is a header bar box it will be below the titlebar. The box itself is just doing the layout so it uses the window behind it. You can draw on the win

Re: Custom GtkHeaderBar

2017-04-13 Thread Takao Fujiwara
Thanks for the example. But I'd pull the CSS color of GtkHeaderBar to follow the theme colors instead of the hardcoded draw_box(). As I attached in the previous mail, calling gtk_widget_class_set_css_name(class, "headerbar") can set the themed background-color but the behavior is different betwe

Re: Custom GtkHeaderBar

2017-04-13 Thread Eric Cashon via gtk-app-devel-list
Hi Fujiwara, The GtkBox is going to use the background window for it's color. The box just does the layout. If you create a header bar from a box you will have to draw on the background where your header bar is going to be. This can get a little tricky to get the measurements that you need. A

Re: Custom GtkHeaderBar

2017-04-12 Thread Takao Fujiwara
I could resolve this issue to call this.get_style_context().remove_class("csd") after set_titlebar(header) is called. But not sure why I have to remove "csd" class while it's a custom header. Fujiwara On 04/11/17 21:33, Takao Fujiwara-san wrote: I'd like to create a custom GtkHeaderBar in GTK