summaryrefslogtreecommitdiff
path: root/gtk/gtkhbbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkhbbox.c')
-rw-r--r--gtk/gtkhbbox.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkhbbox.c b/gtk/gtkhbbox.c
index 694ea02a8d..399ae19c04 100644
--- a/gtk/gtkhbbox.c
+++ b/gtk/gtkhbbox.c
@@ -83,7 +83,7 @@ void
gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout)
{
g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE &&
- layout <= GTK_BUTTONBOX_END);
+ layout <= GTK_BUTTONBOX_CENTER);
default_layout_style = layout;
}
@@ -148,6 +148,7 @@ gtk_hbutton_box_size_request (GtkWidget *widget,
case GTK_BUTTONBOX_EDGE:
case GTK_BUTTONBOX_START:
case GTK_BUTTONBOX_END:
+ case GTK_BUTTONBOX_CENTER:
requisition->width = nvis_children*child_width + ((nvis_children-1)*spacing);
break;
default:
@@ -235,6 +236,16 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget,
- GTK_CONTAINER (box)->border_width;
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
break;
+ case GTK_BUTTONBOX_CENTER:
+ childspacing = spacing;
+ x = allocation->x +
+ (allocation->width
+ - (child_width * (nvis_children - n_secondaries)
+ + spacing * (nvis_children - n_secondaries - 1)))/2
+ + (n_secondaries * child_width + n_secondaries * spacing)/2
+ + GTK_CONTAINER (box)->border_width;
+ secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
+ break;
default:
g_assert_not_reached();
break;