always position the menu inside the screen boundaries.
2000-09-14 Michael Natterer <mitch@gimp.org> * app/disp_callbacks.c: always position the menu inside the screen boundaries.
This commit is contained in:
committed by
Michael Natterer
parent
9d4e8b7d27
commit
659d46c2d8
@ -1,3 +1,8 @@
|
||||
2000-09-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/disp_callbacks.c: always position the menu inside the
|
||||
screen boundaries.
|
||||
|
||||
2000-09-14 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/disp_callbacks.c: new function gdisplay_origin_menu_position()
|
||||
|
||||
@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
|
||||
|
||||
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
|
||||
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width;
|
||||
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
|
||||
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
|
||||
|
||||
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
|
||||
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
|
||||
|
||||
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
|
||||
*y -= (GTK_WIDGET (menu)->allocation.height);
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
|
||||
|
||||
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
|
||||
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width;
|
||||
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
|
||||
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
|
||||
|
||||
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
|
||||
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
|
||||
|
||||
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
|
||||
*y -= (GTK_WIDGET (menu)->allocation.height);
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
@ -686,8 +686,14 @@ gdisplay_origin_menu_position (GtkMenu *menu,
|
||||
|
||||
gdk_window_get_origin (origin->window, &origin_x, &origin_y);
|
||||
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width;
|
||||
*y = origin_y + origin->allocation.y + origin->allocation.height / 2;
|
||||
*x = origin_x + origin->allocation.x + origin->allocation.width - 1;
|
||||
*y = origin_y + origin->allocation.y + (origin->allocation.height - 1) / 2;
|
||||
|
||||
if (*x + GTK_WIDGET (menu)->allocation.width > gdk_screen_width ())
|
||||
*x -= (GTK_WIDGET (menu)->allocation.width + origin->allocation.width);
|
||||
|
||||
if (*y + GTK_WIDGET (menu)->allocation.height > gdk_screen_height ())
|
||||
*y -= (GTK_WIDGET (menu)->allocation.height);
|
||||
}
|
||||
|
||||
gint
|
||||
|
||||
Reference in New Issue
Block a user