From 09daf335df3b10c67e882234b2f1b11ff097afaf Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 30 Nov 2021 15:46:01 +0200 Subject: Placement of popup menus at bottom of window Don't do a selection highlight if the menu is at the bottom of the window, that would be too much scrolling. --- src/ui/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/util.c b/src/ui/util.c index fe5e5393..cfb2b230 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1036,7 +1036,8 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, int menuOpenFlags) { setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); arrange_Widget(d); /* need to know the height */ iBool allowOverflow = iFalse; - /* A vertical offset determined by a possible selected label in the menu. */ { + /* A vertical offset determined by a possible selected label in the menu. */ + if (windowCoord.y < rootSize.y - lineHeight_Text(uiNormal_FontSize) * 3) { iConstForEach(ObjectList, child, children_Widget(d)) { const iWidget *item = constAs_Widget(child.object); if (flags_Widget(item) & selected_WidgetFlag) { -- cgit v1.2.3