box gadget: Redo expand flag handling

We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
This commit is contained in:
Matthias Clasen
2016-04-28 21:55:52 -04:00
parent 8a308dd072
commit 2148708917
7 changed files with 67 additions and 101 deletions

View File

@ -671,13 +671,6 @@ gtk_range_sync_orientation (GtkRange *range)
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (range));
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
gtk_box_gadget_set_orientation (GTK_BOX_GADGET (priv->contents_gadget), orientation);
if (orientation == GTK_ORIENTATION_VERTICAL)
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->contents_gadget),
priv->trough_gadget, FALSE, TRUE);
else
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->contents_gadget),
priv->trough_gadget, TRUE, FALSE);
}
static void
@ -825,7 +818,7 @@ gtk_range_init (GtkRange *range)
gtk_css_gadget_set_state (priv->trough_gadget,
gtk_css_node_get_state (widget_node));
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->contents_gadget), -1, priv->trough_gadget,
TRUE, FALSE, GTK_ALIGN_CENTER);
TRUE, GTK_ALIGN_CENTER);
priv->slider_gadget = gtk_builtin_icon_new ("slider",
GTK_WIDGET (range),
@ -3964,7 +3957,7 @@ sync_stepper_gadget (GtkRange *range,
gtk_css_gadget_set_state (gadget, gtk_css_node_get_state (widget_node));
gtk_box_gadget_insert_gadget_after (GTK_BOX_GADGET (priv->contents_gadget), prev_sibling,
gadget, FALSE, FALSE, GTK_ALIGN_FILL);
gadget, FALSE, GTK_ALIGN_FILL);
*gadget_ptr = gadget;
}