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 697554 - OSD class shouldn't use toolbar as container widget
OSD class shouldn't use toolbar as container widget
Status: RESOLVED FIXED
Product: gnome-themes-standard
Classification: Core
Component: Adwaita GTK3 theme
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-themes-standard-maint
gnome-themes-standard-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-08 12:43 UTC by Bastien Nocera
Modified: 2013-04-24 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
too small (71.23 KB, image/png)
2013-04-08 12:45 UTC, Bastien Nocera
Details
just big enough (74.67 KB, image/png)
2013-04-08 12:46 UTC, Bastien Nocera
Details
wrongly styled button (75.78 KB, image/png)
2013-04-08 12:48 UTC, Bastien Nocera
Details

Description Bastien Nocera 2013-04-08 12:43:46 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.
Comment 1 Bastien Nocera 2013-04-08 12:45:50 UTC
Created attachment 240945 [details]
too small
Comment 2 Bastien Nocera 2013-04-08 12:46:52 UTC
Created attachment 240946 [details]
just big enough

What a difference 6 pixels make.
Comment 3 Bastien Nocera 2013-04-08 12:48:05 UTC
Created attachment 240947 [details]
wrongly styled button
Comment 4 Matthias Clasen 2013-04-08 13:29:26 UTC
Is this this a trick ?!  I don't see any button in the last screenshot...
Comment 5 Cosimo Cecchi 2013-04-08 18:22:48 UTC
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.
Comment 6 Bastien Nocera 2013-04-09 07:22:17 UTC
(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.
Comment 7 Bastien Nocera 2013-04-09 07:35:45 UTC
> (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.
Comment 8 Bastien Nocera 2013-04-09 07:45:37 UTC
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,
Comment 9 Bastien Nocera 2013-04-24 15:18:00 UTC
There's more theming related problems, which I'll file separately. Thanks for the help.