After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706045 - Set GtkBox as titlebar of the window - the background of the box is becomes transparent
Set GtkBox as titlebar of the window - the background of the box is becomes t...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 706068
 
 
Reported: 2013-08-15 02:20 UTC by Yosef Or Boczko
Modified: 2013-08-28 17:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot (900.25 KB, image/png)
2013-08-15 02:20 UTC, Yosef Or Boczko
  Details
Screenshot - two windows (391.17 KB, image/png)
2013-08-15 07:59 UTC, Yosef Or Boczko
  Details
stylecontext: add GTK_STYLE_CLASS_TITLEBAR define (1.94 KB, patch)
2013-08-16 17:27 UTC, Cosimo Cecchi
committed Details | Review
window: set GTK_STYLE_CLASS_TITLEBAR to custom titles (912 bytes, patch)
2013-08-16 17:27 UTC, Cosimo Cecchi
committed Details | Review

Description Yosef Or Boczko 2013-08-15 02:20:02 UTC
Created attachment 251678 [details]
Screenshot

If I set the GtkBox as titlebar of the window,
the background of the box is becomes transparent.

see image.
Comment 1 Matthias Clasen 2013-08-15 03:36:01 UTC
As a quickfix, you can put the box into an eventbox, call gtk_event_box_set_visible_window on that, and give it a style class that gives it the right background, like "titlebar".

The proper longterm fix is to make the box render a background
Comment 2 Yosef Or Boczko 2013-08-15 07:56:55 UTC
It works fine, but if I open other window and showing that above
the previous window, again - the background of the box 
in the previous window (which in under) is becomes transparent.
Comment 3 Yosef Or Boczko 2013-08-15 07:59:56 UTC
Created attachment 251696 [details]
Screenshot - two windows
Comment 4 Matthias Clasen 2013-08-15 11:31:34 UTC
theme issue - looks like the event box is getting a transparent background in backdrop.
Comment 5 Cosimo Cecchi 2013-08-16 17:27:26 UTC
Created attachment 251919 [details] [review]
stylecontext: add GTK_STYLE_CLASS_TITLEBAR define

For consistency with the other stock style classes.
Comment 6 Cosimo Cecchi 2013-08-16 17:27:31 UTC
Created attachment 251920 [details] [review]
window: set GTK_STYLE_CLASS_TITLEBAR to custom titles

When a custom title is added to a GtkWindow, add the
GTK_STYLE_CLASS_TITLEBAR to it, so the theme can apply the default rules
for its style.
Comment 7 Matthias Clasen 2013-08-16 17:52:34 UTC
Review of attachment 251919 [details] [review]:

sure

::: gtk/gtkstylecontext.h
@@ +740,3 @@
+ *
+ * A CSS class used when rendering a titlebar in a toplevel
+ * window.

Do we put "Since: 3.10" in these ? not sure...
Comment 8 Matthias Clasen 2013-08-16 17:53:35 UTC
Review of attachment 251920 [details] [review]:

I'm very slightly uneasy about adding style classes to external widgets like that, but it probably doesn't hurt
Comment 9 Matthias Clasen 2013-08-17 03:19:32 UTC
Attachment 251919 [details] pushed as 3ea0e4a - stylecontext: add GTK_STYLE_CLASS_TITLEBAR define
Attachment 251920 [details] pushed as 9896b99 - window: set GTK_STYLE_CLASS_TITLEBAR to custom titles
Comment 10 Claudio Saavedra 2013-08-28 17:33:14 UTC
I suppose the suggested eventbox can fly away, no?