GNOME Bugzilla – Bug 697554
OSD class shouldn't use toolbar as container widget
Last modified: 2013-04-24 15:18:00 UTC
Using a toolbar as a container widget creates problems for apps where the OSD would be the biggest UI item. In particular: - toolbars have no minimum width, when we really want all the children widgets to dictate the size of the OSD - buttons get styled like they're in a actual toolbar. I would rather a grid was used to contain the OSD's contents, though it might not have the necessary stylings.
Created attachment 240945 [details] too small
Created attachment 240946 [details] just big enough What a difference 6 pixels make.
Created attachment 240947 [details] wrongly styled button
Is this this a trick ?! I don't see any button in the last screenshot...
Using a grid instead of a toolbar should be possible, but you will have to wrap it in a base container that renders the background for you. My recommendation would probably be to use a GtkFrame around the grid, and add the "osd" and "background" style classes to it. Then, buttons will not use the linked style anymore. If you want to use it for some specific sections, you should pack buttons into a box and set the "linked" class on it, but I don't think we support that for the OSD style yet. It'd be great if you could push what you currently have for the OSD controls to a totem branch and we could work together evolving it and the theme in parallel to fill in any gaps.
(In reply to comment #4) > Is this this a trick ?! I don't see any button in the last screenshot... The volume button on the right hand-side of the controls bar is a button being hovered by the mouse. (In reply to comment #5) > Using a grid instead of a toolbar should be possible, but you will have to wrap > it in a base container that renders the background for you. > My recommendation would probably be to use a GtkFrame around the grid, and add > the "osd" and "background" style classes to it. OK. > Then, buttons will not use the linked style anymore. If you want to use it for > some specific sections, you should pack buttons into a box and set the "linked" > class on it, but I don't think we support that for the OSD style yet. I don't need it. > It'd be great if you could push what you currently have for the OSD controls to > a totem branch and we could work together evolving it and the theme in parallel > to fill in any gaps. It's been in Bugzilla since I first talked to you about it, see bug 694435.
> (In reply to comment #5) > > Using a grid instead of a toolbar should be possible, but you will have to wrap > > it in a base container that renders the background for you. > > My recommendation would probably be to use a GtkFrame around the grid, and add > > the "osd" and "background" style classes to it. > > OK. Using a GtkFrame with the background class shows me a background, but the osd class applied doesn't add any styling to the OSD. I'm using gnome-themes-standard from master.
This makes it style the OSD as expected, though I doubt this is correct for all use cases: diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css index 7e8308f..c76a38b 100644 --- a/themes/Adwaita/gtk-3.0/gtk-widgets.css +++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css @@ -2747,6 +2747,19 @@ GtkOverlay.osd { .osd.frame { background-clip: border-box; background-origin: border-box; + + color: @osd_fg; + text-shadow: 0 1px @osd_text_shadow; + + padding: 10px; + border-style: none; + border-radius: 7px; + background-image: linear-gradient(to bottom, + @osd_toolbar_bg_a, + @osd_toolbar_bg_b 63%, + @osd_toolbar_bg_c + ); + background-color: transparent; } .osd.button,
There's more theming related problems, which I'll file separately. Thanks for the help.