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 762397 - GtkToolButton needs left & right padding and margin
GtkToolButton needs left & right padding and margin
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-21 11:05 UTC by Arnaud B.
Modified: 2017-08-18 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Liferea in Rawhide. (24.47 KB, image/png)
2016-02-21 11:05 UTC, Arnaud B.
Details

Description Arnaud B. 2016-02-21 11:05:20 UTC
Created attachment 321771 [details]
Liferea in Rawhide.

GtkToolButton needs some left & right padding (the top & bottom spacing look good to me, but it’s maybe only a min-height?), and when placed in a GtkToolbar (the usual case) some left & right margin.
Comment 1 Matthias Clasen 2016-02-23 21:01:05 UTC
evolution has the same problem
Comment 2 Lapo Calamandrei 2016-03-02 18:48:33 UTC
The theme behaves here, all the buttons in the screenshot have just the "image-button" styleclass while there's text inside too so the "text-button" class should be there as well. About the margin I'm not sure it's a good idea, probably having something like "border-spacing" css prop on the toolbar would be better.
Comment 3 Lapo Calamandrei 2016-03-02 18:55:03 UTC
GtkToolbar -> toolbar-style:

GTK_TOOLBAR_ICONS = toolbar > toolbutton > button.image-button
GTK_TOOLBAR_TEXT = toolbar > toolbutton > button.text-button
GTK_TOOLBAR_BOTH = toolbar > toolbutton > button.<new class needed>
GTK_TOOLBAR_BOTH_HORIZ = toolbar > toolbutton -> button.image-button.text-button
Comment 4 Matthias Clasen 2016-03-02 19:08:59 UTC
(In reply to Lapo Calamandrei from comment #2)
> The theme behaves here, all the buttons in the screenshot have just the
> "image-button" styleclass while there's text inside too so the "text-button"
> class should be there as well. About the margin I'm not sure it's a good
> idea, probably having something like "border-spacing" css prop on the
> toolbar would be better.

New css properties are not happening in the short term. You gotta make do with what you have for once.
Comment 5 Lapo Calamandrei 2016-03-03 01:19:04 UTC
If I always worked with what I had the gtk+ theming machinery would be a mess still! :-)
Anyway what I have could work on single bars, but not on grids, and I guess a toolbar can contain basically any widget, right? If it is using margins requires quite a bit of special casing making Adwaita unmaintainable, I can do that as a short term solution, but historically my short term solutions tend to became pretty definitive you know.
Comment 6 Matthias Clasen 2016-03-03 13:19:14 UTC
It would kinda suck to go out with 3.20 saying:

"we've done all this work in gtk+ to make css more powerful... and we've rewritten the theme to us all this new machinery.. and sorry that your toolbars are broken now - but look how shiny our new css is"
Comment 7 Lapo Calamandrei 2016-03-03 15:05:00 UTC
Yeah, true, going for the "temporary" solution, I hope to have something better in the future.
So fixed with commit 3549490aa8f9744c9165325ef6edf05222022dcb leaving the
bug open for the styleclass issue.
Comment 8 Daniel Boles 2017-08-18 19:34:49 UTC
So, the main/title issue here was fixed. Moreover, border-spacing is now available in CSS in GTK+ 4. I've opened Bug 786483 to ask if that can be backported to GTK+ 3.