[gtk+] Use gtk_widget_get_allocated_width/height where it makes sense
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use gtk_widget_get_allocated_width/height where it makes sense
- Date: Fri, 23 Dec 2011 05:37:23 +0000 (UTC)
commit a553cb50ab4aa0349e6fb9c39b0f7f71eebf50ec
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 23 04:42:12 2011 +0000
Use gtk_widget_get_allocated_width/height where it makes sense
gtk/gtkmenu.c | 6 ++----
gtk/gtkstatusicon.c | 4 ++--
2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 2d29caa..1f0fb37 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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,
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index 180936e..e6d5520 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]