diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-13 06:54:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-14 03:17:42 +0800 |
commit | a6d296b998729abc78e634844cc4a3aeda7d0327 (patch) | |
tree | 136c24bd250a288f8152cd563969f3954adc75be /widgets/misc/e-attachment-button.c | |
parent | 4d114e022ca38e7aeb6cc2cc3715f7dca69c82a6 (diff) | |
download | gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.tar.gz gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.tar.zst gsoc2013-evolution-a6d296b998729abc78e634844cc4a3aeda7d0327.zip |
Baby steps toward GSEAL compliance.
Diffstat (limited to 'widgets/misc/e-attachment-button.c')
-rw-r--r-- | widgets/misc/e-attachment-button.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index adf40d4df4..192344068b 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -81,6 +81,7 @@ attachment_button_menu_position (GtkMenu *menu, { GtkRequisition menu_requisition; GtkTextDirection direction; + GtkAllocation allocation; GdkRectangle monitor; GdkScreen *screen; GdkWindow *window; @@ -99,24 +100,28 @@ attachment_button_menu_position (GtkMenu *menu, monitor_num = 0; gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + gtk_widget_get_allocation (widget, &allocation); + gdk_window_get_origin (window, x, y); - *x += widget->allocation.x; - *y += widget->allocation.y; + *x += allocation.x; + *y += allocation.y; direction = gtk_widget_get_direction (widget); if (direction == GTK_TEXT_DIR_LTR) - *x += MAX (widget->allocation.width - menu_requisition.width, 0); - else if (menu_requisition.width > widget->allocation.width) - *x -= menu_requisition.width - widget->allocation.width; + *x += MAX (allocation.width - menu_requisition.width, 0); + else if (menu_requisition.width > allocation.width) + *x -= menu_requisition.width - allocation.width; + + gtk_widget_get_allocation (toggle_button, &allocation); - if ((*y + toggle_button->allocation.height + + if ((*y + allocation.height + menu_requisition.height) <= monitor.y + monitor.height) - *y += toggle_button->allocation.height; + *y += allocation.height; else if ((*y - menu_requisition.height) >= monitor.y) *y -= menu_requisition.height; else if (monitor.y + monitor.height - - (*y + toggle_button->allocation.height) > *y) - *y += toggle_button->allocation.height; + (*y + allocation.height) > *y) + *y += allocation.height; else *y -= menu_requisition.height; |