Commit 1258eadd authored by Matthias Clasen's avatar Matthias Clasen
Browse files

button box: Set linked style for extend

This is needed for proper styling of the new extend-placement
in button boxes.
parent 00326d33
......@@ -132,6 +132,13 @@ static void gtk_button_box_get_child_property (GtkContainer *container,
G_DEFINE_TYPE_WITH_PRIVATE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
static void
gtk_button_box_add (GtkContainer *container,
GtkWidget *widget)
{
gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
}
static void
gtk_button_box_class_init (GtkButtonBoxClass *class)
{
......@@ -154,6 +161,7 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
widget_class->size_allocate = gtk_button_box_size_allocate;
container_class->remove = gtk_button_box_remove;
container_class->add = gtk_button_box_add;
container_class->set_child_property = gtk_button_box_set_child_property;
container_class->get_child_property = gtk_button_box_get_child_property;
gtk_container_class_handle_border_width (container_class);
......@@ -349,10 +357,18 @@ gtk_button_box_set_layout (GtkButtonBox *widget,
if (priv->layout_style != layout_style)
{
priv->layout_style = layout_style;
if (priv->layout_style == GTK_BUTTONBOX_EXPAND)
gtk_box_set_homogeneous (GTK_BOX (widget), TRUE);
{
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (widget)), "linked");
gtk_box_set_homogeneous (GTK_BOX (widget), TRUE);
}
else
gtk_box_set_homogeneous (GTK_BOX (widget), FALSE);
{
gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (widget)), "linked");
gtk_box_set_homogeneous (GTK_BOX (widget), FALSE);
}
g_object_notify (G_OBJECT (widget), "layout-style");
gtk_widget_queue_resize (GTK_WIDGET (widget));
}
......@@ -435,8 +451,7 @@ gtk_button_box_set_child_secondary (GtkButtonBox *widget,
if (bbox->priv->layout_style == GTK_BUTTONBOX_EXPAND)
{
gtk_box_set_child_packing (GTK_BOX (bbox), child, TRUE, TRUE, 0,
is_secondary ? GTK_PACK_START : GTK_PACK_END);
gtk_box_reorder_child (GTK_BOX (bbox), child, is_secondary ? 0 : -1);
}
if (gtk_widget_get_visible (GTK_WIDGET (widget)) &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment