GNOME Bugzilla – Bug 762397
GtkToolButton needs left & right padding and margin
Last modified: 2017-08-18 19:34:49 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.
evolution has the same problem
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.
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
(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.
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.
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"
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.
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.