mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
paned: Don't reorder css nodes based on text direction
This commit is contained in:
parent
85e49a1051
commit
da27627696
@ -98,9 +98,10 @@
|
|||||||
* the separator with name separator. The subnode gets a .wide style
|
* the separator with name separator. The subnode gets a .wide style
|
||||||
* class when the paned is supposed to be wide.
|
* class when the paned is supposed to be wide.
|
||||||
*
|
*
|
||||||
* In horizontal orientation, the nodes of the children are always arranged
|
* In horizontal orientation, the nodes are arranged based on the text
|
||||||
* from left to right. So :first-child will always select the leftmost child,
|
* direction, so in left-to-right mode, :first-child will select the
|
||||||
* regardless of text direction.
|
* leftmost child, while it will select the rightmost child in
|
||||||
|
* RTL layouts.
|
||||||
*
|
*
|
||||||
* ## Creating a paned widget with minimum sizes.
|
* ## Creating a paned widget with minimum sizes.
|
||||||
*
|
*
|
||||||
@ -218,8 +219,6 @@ static void gtk_paned_size_allocate (GtkWidget *widget,
|
|||||||
const GtkAllocation *allocation,
|
const GtkAllocation *allocation,
|
||||||
int baseline);
|
int baseline);
|
||||||
static void gtk_paned_unrealize (GtkWidget *widget);
|
static void gtk_paned_unrealize (GtkWidget *widget);
|
||||||
static void gtk_paned_direction_changed (GtkWidget *widget,
|
|
||||||
GtkTextDirection previous_direction);
|
|
||||||
static void gtk_paned_snapshot (GtkWidget *widget,
|
static void gtk_paned_snapshot (GtkWidget *widget,
|
||||||
GtkSnapshot *snapshot);
|
GtkSnapshot *snapshot);
|
||||||
static gboolean gtk_paned_focus (GtkWidget *widget,
|
static gboolean gtk_paned_focus (GtkWidget *widget,
|
||||||
@ -372,7 +371,6 @@ gtk_paned_class_init (GtkPanedClass *class)
|
|||||||
widget_class->unrealize = gtk_paned_unrealize;
|
widget_class->unrealize = gtk_paned_unrealize;
|
||||||
widget_class->snapshot = gtk_paned_snapshot;
|
widget_class->snapshot = gtk_paned_snapshot;
|
||||||
widget_class->focus = gtk_paned_focus;
|
widget_class->focus = gtk_paned_focus;
|
||||||
widget_class->direction_changed = gtk_paned_direction_changed;
|
|
||||||
widget_class->pick = gtk_paned_pick;
|
widget_class->pick = gtk_paned_pick;
|
||||||
|
|
||||||
container_class->add = gtk_paned_add;
|
container_class->add = gtk_paned_add;
|
||||||
@ -1575,17 +1573,6 @@ gtk_paned_focus (GtkWidget *widget,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_paned_direction_changed (GtkWidget *widget,
|
|
||||||
GtkTextDirection previous_direction)
|
|
||||||
{
|
|
||||||
GtkPaned *paned = GTK_PANED (widget);
|
|
||||||
GtkPanedPrivate *priv = gtk_paned_get_instance_private (paned);
|
|
||||||
|
|
||||||
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
||||||
gtk_css_node_reverse_children (gtk_widget_get_css_node (widget));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_paned_new:
|
* gtk_paned_new:
|
||||||
* @orientation: the paned’s orientation.
|
* @orientation: the paned’s orientation.
|
||||||
@ -1660,9 +1647,6 @@ gtk_paned_pack1 (GtkPaned *paned,
|
|||||||
priv->child1_resize = resize;
|
priv->child1_resize = resize;
|
||||||
priv->child1_shrink = shrink;
|
priv->child1_shrink = shrink;
|
||||||
|
|
||||||
if (gtk_widget_get_direction (GTK_WIDGET (paned)) == GTK_TEXT_DIR_RTL)
|
|
||||||
gtk_widget_insert_after (child, GTK_WIDGET (paned), priv->handle_widget);
|
|
||||||
else
|
|
||||||
gtk_widget_insert_before (child, GTK_WIDGET (paned), priv->handle_widget);
|
gtk_widget_insert_before (child, GTK_WIDGET (paned), priv->handle_widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1693,9 +1677,6 @@ gtk_paned_pack2 (GtkPaned *paned,
|
|||||||
priv->child2_resize = resize;
|
priv->child2_resize = resize;
|
||||||
priv->child2_shrink = shrink;
|
priv->child2_shrink = shrink;
|
||||||
|
|
||||||
if (gtk_widget_get_direction (GTK_WIDGET (paned)) == GTK_TEXT_DIR_RTL)
|
|
||||||
gtk_widget_insert_before (child, GTK_WIDGET (paned), priv->handle_widget);
|
|
||||||
else
|
|
||||||
gtk_widget_insert_after (child, GTK_WIDGET (paned), priv->handle_widget);
|
gtk_widget_insert_after (child, GTK_WIDGET (paned), priv->handle_widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[window.background:dir(rtl)]
|
[window.background:dir(rtl)]
|
||||||
decoration:dir(rtl)
|
decoration:dir(rtl)
|
||||||
paned.horizontal:dir(rtl)
|
paned.horizontal:dir(rtl)
|
||||||
label#label2:dir(rtl)
|
|
||||||
separator:dir(rtl)
|
|
||||||
label#label1:dir(rtl)
|
label#label1:dir(rtl)
|
||||||
|
separator:dir(rtl)
|
||||||
|
label#label2:dir(rtl)
|
||||||
|
Loading…
Reference in New Issue
Block a user