diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/util.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 640b3112..8affa57e 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1023,11 +1023,13 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, int menuOpenFlags) { | |||
1023 | setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); | 1023 | setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); |
1024 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); | 1024 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); |
1025 | arrange_Widget(d); /* need to know the height */ | 1025 | arrange_Widget(d); /* need to know the height */ |
1026 | iBool allowOverflow = iFalse; | ||
1026 | /* A vertical offset determined by a possible selected label in the menu. */ { | 1027 | /* A vertical offset determined by a possible selected label in the menu. */ { |
1027 | iConstForEach(ObjectList, child, children_Widget(d)) { | 1028 | iConstForEach(ObjectList, child, children_Widget(d)) { |
1028 | const iWidget *item = constAs_Widget(child.object); | 1029 | const iWidget *item = constAs_Widget(child.object); |
1029 | if (flags_Widget(item) & selected_WidgetFlag) { | 1030 | if (flags_Widget(item) & selected_WidgetFlag) { |
1030 | windowCoord.y -= item->rect.pos.y; | 1031 | windowCoord.y -= item->rect.pos.y; |
1032 | allowOverflow = iTrue; | ||
1031 | } | 1033 | } |
1032 | } | 1034 | } |
1033 | } | 1035 | } |
@@ -1129,11 +1131,13 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, int menuOpenFlags) { | |||
1129 | rightExcess += r; | 1131 | rightExcess += r; |
1130 | } | 1132 | } |
1131 | #endif | 1133 | #endif |
1132 | if (bottomExcess > 0 && (!isPortraitPhone || !isSlidePanel)) { | 1134 | if (!allowOverflow) { |
1133 | d->rect.pos.y -= bottomExcess; | 1135 | if (bottomExcess > 0 && (!isPortraitPhone || !isSlidePanel)) { |
1134 | } | 1136 | d->rect.pos.y -= bottomExcess; |
1135 | if (topExcess > 0) { | 1137 | } |
1136 | d->rect.pos.y += topExcess; | 1138 | if (topExcess > 0) { |
1139 | d->rect.pos.y += topExcess; | ||
1140 | } | ||
1137 | } | 1141 | } |
1138 | if (rightExcess > 0) { | 1142 | if (rightExcess > 0) { |
1139 | d->rect.pos.x -= rightExcess; | 1143 | d->rect.pos.x -= rightExcess; |