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 745317 - Add a convenience container class that enables setting of the preferred, maximum, and minimum child widget size
Add a convenience container class that enables setting of the preferred, maxi...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-02-28 00:18 UTC by Niels Nesse
Modified: 2018-05-02 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Niels Nesse 2015-02-28 00:18:23 UTC
At present a user that wants to change the preferred size of widget must subclass the widget and override gtk_widget_get_preferred_size(). This confuses some new users and is arguably an arduous requirement when the developer is otherwise not subclassing any widgets.

I propose that a new convenience container class be created that derives from GtkBin that includes properties to force the minimum, maximum, and preferred sizes or optionally defer to the child widget's values. It might also be useful to include the ability to specify the child widget's relative position within the container in fractional terms.
Comment 1 Rafal Luzynski 2015-02-28 01:04:03 UTC
I support this idea. Also I would like to see the ability to express the size (may be called "weight") of the child and its padding (the distance from the edge of the container to the edge of the child) as fractions of the total size.

I think that with a relative position we need something like an alignment property to determine if the relative position applies to the left/right/top/bottom edge of the child or to its center.

All these features would be very useful for the user interface designs which automatically adapt to any window size and any screen size and orientation and keep their ratio reasonable.
Comment 2 Daniel Boles 2017-08-25 00:07:59 UTC
Comment 1 sounds like mostly unrelated material for another ticket, and the kind of thing that Emeus is aimed towards; see https://blog.gtk.org/2017/08/07/progress-towards-gtk-4/ as a good jumping-off point.

As for the real topic, off the top of my head, you could probably do some of it with ScrolledWindow, forcing off the scrollbars, and setting min-content-(width|height) xor propagate-natural-(width|height) - however I've never tried using it for this purpose so don't know.
Comment 3 GNOME Infrastructure Team 2018-05-02 16:26:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/535.