GNOME Bugzilla – Bug 595741
No way to set the minimum child widget size of a GtkButtonBox
Last modified: 2016-01-24 05:02:39 UTC
There doesn't seem to be any valid way to set the minimum size of a child in a GtkButtonBox. gtk_button_box_set_child_size() works, but is marked deprecated. The doc advises to use the properties "child-min-width" and "child-min-height" instead, but these two properties are read-only, not read-write.
The documentation is slightly off here, or maybe just not explicit enough. Those are style properties meant to be used in themes. Although it is possible to work around it, applications shouldn't modify those. May I ask what your use case is? I fail to find out why this was deprecated with git blame, so I don't know if there was a good reason for that.
I briefly described the use-case in bug #595742, comment 3 (sorry for the cross-bug-report-confusion). Brief repetition: I'd like to put a non-obtrusive, minimum size, icon only close button into the bar. One of the kind that is often found in indivudual tabs of tabbed-interfaces, or e.g. to the left of the Firefox search bar.
Created attachment 227055 [details] Screenshot of oversized buttons in a GtkButtonBox in a docked dialog Just adding my voice to this... We used to set the min child width in a ButtonBox in a dockable dialog in Inkscape [via the Gtk::ButtonBox::set_child_min_width() method in Gtkmm]. The buttons in question each contained just a compact icon (no text), so we set the min child width to 16 to allow a bunch of them to be neatly arranged horizontally. Now that the setting has been removed, the fixed min child width of 85 made the dockable dialog so wide that it took up too much of the application window. The Inkscape bug report is here: https://bugs.launchpad.net/inkscape/+bug/1069181 I'll upload an image of the dialog containing massive buttons that we'd like to shrink homogeneously. As a workaround, I just switched to using a GtkBox, but I hope this illustrates a use-case for set_child_min_width
we now support min-width and min-height in css