[gimp/gimp-2-10] app: show popup menus at the same height as their corresponding button



commit d916e3ca21f4fc98f55d23e35e623e9386fdfe40
Author: Ell <ell_se yahoo com>
Date:   Wed Jan 29 21:50:42 2020 +0200

    app: show popup menus at the same height as their corresponding button
    
    In gimp_button_menu_position(), position the menu at the same
    height as the button, instead of half-way down.  This is mostly a
    stylistic choice, but it works much better for tool-button menus,
    added in the next commit.

 app/widgets/gimpwidgets-utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index ce821ab228..6b9de67680 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -208,10 +208,8 @@ gimp_button_menu_position (GtkWidget       *button,
       break;
     }
 
-  *y += button_allocation.height / 2;
-
   if (*y + menu_requisition.height > rect.y + rect.height)
-    *y -= menu_requisition.height;
+    *y -= menu_requisition.height - button_allocation.height;
 
   if (*y < rect.y)
     *y = rect.y;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]