diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2019-04-12 17:08:21 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2019-04-12 17:10:30 +0100 |
commit | a27737b04e61af4ca0fc75fa027da84fdc5a71e5 (patch) | |
tree | 9d2532edb8443de3497ce25ea60b3fc9992a2d81 /gtk/gtkboxlayout.c | |
parent | bd2d07e671422cb3c016d58ea025f4c4e75cbf52 (diff) | |
download | gtk+-a27737b04e61af4ca0fc75fa027da84fdc5a71e5.tar.gz |
Add default GtkLayoutManagerClass.get_request_mode()
Just like GtkContainer provides a default implementation of
GtkWidgetClass.get_request_mode(), we can do the same inside
GtkLayoutManager.
A default implementation preserves the behavior of existing widgets that
moved, or will move, to a GtkLayoutManager.
Diffstat (limited to 'gtk/gtkboxlayout.c')
-rw-r--r-- | gtk/gtkboxlayout.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/gtk/gtkboxlayout.c b/gtk/gtkboxlayout.c index 259a4822c9..88215192a0 100644 --- a/gtk/gtkboxlayout.c +++ b/gtk/gtkboxlayout.c @@ -199,42 +199,6 @@ get_spacing (GtkBoxLayout *self, return css_spacing + self->spacing; } -static GtkSizeRequestMode -gtk_box_layout_get_request_mode (GtkLayoutManager *layout_manager, - GtkWidget *widget) -{ - GtkWidget *child; - int wfh = 0, hfw = 0; - - for (child = _gtk_widget_get_first_child (widget); - child != NULL; - child = _gtk_widget_get_next_sibling (child)) - { - GtkSizeRequestMode mode = gtk_widget_get_request_mode (child); - - switch (mode) - { - case GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: - hfw += 1; - break; - - case GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: - wfh += 1; - break; - - case GTK_SIZE_REQUEST_CONSTANT_SIZE: - default: - break; - } - } - - if (hfw == 0 && wfh == 0) - return GTK_SIZE_REQUEST_CONSTANT_SIZE; - else - return wfh > hfw ? GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT - : GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH; -} - static void gtk_box_layout_compute_size (GtkBoxLayout *self, GtkWidget *widget, @@ -738,7 +702,6 @@ gtk_box_layout_class_init (GtkBoxLayoutClass *klass) gobject_class->set_property = gtk_box_layout_set_property; gobject_class->get_property = gtk_box_layout_get_property; - layout_manager_class->get_request_mode = gtk_box_layout_get_request_mode; layout_manager_class->measure = gtk_box_layout_measure; layout_manager_class->allocate = gtk_box_layout_allocate; |