- if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
- priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
- child_requisition.width += toggle_size;
- else
- child_requisition.height += toggle_size;
-
- /* Support for the right justified help menu */
- if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
- && (GTK_MENU_ITEM(child)->right_justify))
- {
- ltr_y = allocation->height -
- child_requisition.height - offset;
- }
- if (gtk_widget_get_visible (child))
- {
- if ((direction == GTK_TEXT_DIR_LTR) ==
- (priv->pack_direction == GTK_PACK_DIRECTION_TTB))
- child_allocation.y = ltr_y;
- else
- child_allocation.y = allocation->height -
- child_requisition.height - ltr_y;
- child_allocation.height = child_requisition.height;
-
- gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
- toggle_size);
- gtk_widget_size_allocate (child, &child_allocation);
-
- ltr_y += child_allocation.height;
- }
- }
+ gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child), toggle_size);
+
+ g_array_append_val (requested_sizes, request);
+
+ size -= request.minimum_size;
+ }
+
+ size = gtk_distribute_natural_allocation (size,
+ requested_sizes->len,
+ (GtkRequestedSize *) requested_sizes->data);
+
+ for (i = 0; i < requested_sizes->len; i++)
+ {
+ GtkAllocation child_allocation = remaining_space;
+ GtkRequestedSize *request = &g_array_index (requested_sizes, GtkRequestedSize, i);
+
+ child_allocation.height = request->minimum_size;
+ remaining_space.height -= request->minimum_size;
+
+ if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
+ GTK_MENU_ITEM (request->data)->priv->right_justify)
+ ttb = !ttb;
+
+ if (ttb)
+ remaining_space.y += request->minimum_size;
+ else
+ child_allocation.y += remaining_space.height;
+
+ gtk_widget_size_allocate (request->data, &child_allocation);
+ }