Use gtk_widget_get_allocated_width/height where it makes sense

This commit is contained in:
Matthias Clasen 2011-12-23 04:42:12 +00:00
parent 53ce519b1f
commit a553cb50ab
2 changed files with 4 additions and 6 deletions

View File

@ -4875,7 +4875,6 @@ gtk_menu_scroll_to (GtkMenu *menu,
gint offset)
{
GtkMenuPrivate *priv = menu->priv;
GtkAllocation allocation;
GtkBorder arrow_border, padding;
GtkWidget *widget;
gint x, y;
@ -4892,9 +4891,8 @@ gtk_menu_scroll_to (GtkMenu *menu,
gtk_adjustment_set_value (priv->tearoff_adjustment, offset);
/* Move/resize the viewport according to arrows: */
gtk_widget_get_allocation (widget, &allocation);
view_width = allocation.width;
view_height = allocation.height;
view_width = gtk_widget_get_allocated_width (widget);
view_height = gtk_widget_get_allocated_height (widget);
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,

View File

@ -2222,8 +2222,8 @@ gtk_status_icon_position_menu (GtkMenu *menu,
gdk_window_get_origin (window, x, y);
gtk_widget_get_preferred_size (GTK_WIDGET (menu),
&menu_req, NULL);
menu_req.width = gtk_widget_get_allocated_width (GTK_WIDGET (menu));
menu_req.height = gtk_widget_get_allocated_height (GTK_WIDGET (menu));
gtk_widget_get_allocation (widget, &allocation);
if (_gtk_tray_icon_get_orientation (tray_icon) == GTK_ORIENTATION_VERTICAL)