diff options
author | Timm Bäder <mail@baedert.org> | 2018-06-10 21:54:25 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-06-18 17:35:02 +0200 |
commit | 01d45382234f272c8bc1d420b2f39c182518f881 (patch) | |
tree | a82a938b5c64768576ffde12e3935372312d6ef3 /gtk/gtkbox.c | |
parent | da276276967599f6906af45fca327f0bbdfa8824 (diff) | |
download | gtk+-01d45382234f272c8bc1d420b2f39c182518f881.tar.gz |
box: Don't reorder children based on text direction
Make :first-child always be the first child, i.e. the leftest one in LTR
and the rightest one in RTL.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index f89c3fd3bc..fd0ebbb573 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -68,10 +68,6 @@ * # CSS nodes * * GtkBox uses a single CSS node with name box. - * - * In horizontal orientation, the nodes of the children are always arranged - * from left to right. So :first-child will always select the leftmost child, - * regardless of text direction. */ #include "config.h" @@ -145,9 +141,6 @@ static void gtk_box_size_allocate (GtkWidget *widget, const GtkAllocation *allocation, int baseline); -static void gtk_box_direction_changed (GtkWidget *widget, - GtkTextDirection previous_direction); - static void gtk_box_set_property (GObject *object, guint prop_id, const GValue *value, @@ -201,7 +194,6 @@ gtk_box_class_init (GtkBoxClass *class) widget_class->size_allocate = gtk_box_size_allocate; widget_class->measure = gtk_box_measure; - widget_class->direction_changed = gtk_box_direction_changed; container_class->add = gtk_box_add; container_class->remove = gtk_box_remove; @@ -852,9 +844,6 @@ gtk_box_update_child_css_position (GtkBox *box, } reverse = child_info->pack == GTK_PACK_END; - if (priv->orientation == GTK_ORIENTATION_HORIZONTAL && - _gtk_widget_get_direction (GTK_WIDGET (box)) == GTK_TEXT_DIR_RTL) - reverse = !reverse; if (reverse) gtk_css_node_insert_before (gtk_widget_get_css_node (GTK_WIDGET (box)), @@ -867,17 +856,6 @@ gtk_box_update_child_css_position (GtkBox *box, } static void -gtk_box_direction_changed (GtkWidget *widget, - GtkTextDirection previous_direction) -{ - GtkBox *box = GTK_BOX (widget); - GtkBoxPrivate *priv = gtk_box_get_instance_private (box); - - if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_css_node_reverse_children (gtk_widget_get_css_node (widget)); -} - -static void gtk_box_pack (GtkBox *box, GtkWidget *child, GtkPackType pack_type) |