mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Fix clicking a menuitem that is above another parent menubox/bar (fix #3386)
This commit is contained in:
parent
59c6c06fa0
commit
1b76076c52
@ -461,12 +461,17 @@ bool MenuBox::onProcessMessage(Message* msg)
|
||||
|
||||
gfx::Point mousePos = static_cast<MouseMessage*>(msg)->position();
|
||||
|
||||
// Get the widget below the mouse cursor
|
||||
auto mgr = manager();
|
||||
if (!mgr)
|
||||
break;
|
||||
|
||||
Widget* picked = mgr->pick(mousePos);
|
||||
|
||||
// Here we catch the filtered messages (menu-bar or the
|
||||
// popuped menu-box) to detect if the user press outside of
|
||||
// the widget
|
||||
if (msg->type() == kMouseDownMessage && m_base != nullptr) {
|
||||
Widget* picked = manager()->pick(mousePos);
|
||||
|
||||
// If one of these conditions are accomplished we have to
|
||||
// close all menus (back to menu-bar or close the popuped
|
||||
// menubox), this is the place where we control if...
|
||||
@ -483,8 +488,6 @@ bool MenuBox::onProcessMessage(Message* msg)
|
||||
}
|
||||
}
|
||||
|
||||
// Get the widget below the mouse cursor
|
||||
Widget* picked = menu->pick(mousePos);
|
||||
if (picked) {
|
||||
if ((picked->type() == kMenuItemWidget) &&
|
||||
!(picked->hasFlags(DISABLED))) {
|
||||
|
Loading…
Reference in New Issue
Block a user