aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-02 20:30:56 +0200
committerEugene Sandulenko2019-10-03 00:05:12 +0200
commita843a902075ae118cd7e0ef0a4110e431c350acd (patch)
tree6a437b43fc24892a07a4e05272e3281e695d990f /graphics/macgui
parentd3df14fce121460ae7ee810fc751e66c17a04b16 (diff)
downloadscummvm-rg350-a843a902075ae118cd7e0ef0a4110e431c350acd.tar.gz
scummvm-rg350-a843a902075ae118cd7e0ef0a4110e431c350acd.tar.bz2
scummvm-rg350-a843a902075ae118cd7e0ef0a4110e431c350acd.zip
GRAPHICS: MACGUI: Implement nested submenu navigation
Diffstat (limited to 'graphics/macgui')
-rw-r--r--graphics/macgui/macmenu.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index 48db04293f..aaa86ae5f4 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -836,13 +836,25 @@ bool MacMenu::mouseClick(int x, int y) {
renderSubmenu(it);
_contentIsDirty = true;
}
- } else if (_menuActivated && _activeItem != -1 && _activeSubItem != -1) {
+ } else if (_menuActivated && _activeSubItem != -1) {
+ if (_menustack.back()->subitems[_activeSubItem]->submenu != nullptr) {
+ if (_menustack.back()->subitems[_activeSubItem]->submenu->bbox.contains(x, y)) {
+ _menustack.push_back(_menustack.back()->subitems[_activeSubItem]->submenu);
+
+ _activeSubItem = 0;
+
+ return true;
+ }
+ }
+ } else if (_menuActivated && _activeItem != -1) {
_activeSubItem = -1;
if (_menustack.size()) {
renderSubmenu(_menustack.back());
_contentIsDirty = true;
}
+
+ return true;
}
return false;