mirror of https://github.com/buggins/dlangui.git
Closing the popupMenu by clicking outside, should not pass the event to the control under the mouse.
This commit is contained in:
parent
0048cf482b
commit
b81e34b236
|
@ -1505,8 +1505,11 @@ class Window : CustomEventTarget {
|
|||
if (p is modal)
|
||||
break;
|
||||
if (!insideOneOfPopups) {
|
||||
if (p.onMouseEventOutside(event)) // stop loop when true is returned, but allow other main widget to handle event
|
||||
break;
|
||||
if (event.action == MouseAction.ButtonDown)
|
||||
return true; // mouse button down should do nothing when click outside when popup visible
|
||||
if (p.onMouseEventOutside(event)) {
|
||||
return true; // mouse button up should do nothing when click outside when popup visible
|
||||
}
|
||||
} else {
|
||||
if (dispatchMouseEvent(p, event, cursorIsSet))
|
||||
return true;
|
||||
|
|
|
@ -174,10 +174,10 @@ class PopupWidget : LinearLayout {
|
|||
if (visibility != Visibility.Visible)
|
||||
return false;
|
||||
if (_flags & PopupFlags.CloseOnClickOutside) {
|
||||
if (event.action == MouseAction.ButtonDown) {
|
||||
if (event.action == MouseAction.ButtonUp) {
|
||||
// clicked outside - close popup
|
||||
close();
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (_flags & PopupFlags.CloseOnMouseMoveOutside) {
|
||||
|
|
Loading…
Reference in New Issue