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)
|
if (p is modal)
|
||||||
break;
|
break;
|
||||||
if (!insideOneOfPopups) {
|
if (!insideOneOfPopups) {
|
||||||
if (p.onMouseEventOutside(event)) // stop loop when true is returned, but allow other main widget to handle event
|
if (event.action == MouseAction.ButtonDown)
|
||||||
break;
|
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 {
|
} else {
|
||||||
if (dispatchMouseEvent(p, event, cursorIsSet))
|
if (dispatchMouseEvent(p, event, cursorIsSet))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -174,10 +174,10 @@ class PopupWidget : LinearLayout {
|
||||||
if (visibility != Visibility.Visible)
|
if (visibility != Visibility.Visible)
|
||||||
return false;
|
return false;
|
||||||
if (_flags & PopupFlags.CloseOnClickOutside) {
|
if (_flags & PopupFlags.CloseOnClickOutside) {
|
||||||
if (event.action == MouseAction.ButtonDown) {
|
if (event.action == MouseAction.ButtonUp) {
|
||||||
// clicked outside - close popup
|
// clicked outside - close popup
|
||||||
close();
|
close();
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_flags & PopupFlags.CloseOnMouseMoveOutside) {
|
if (_flags & PopupFlags.CloseOnMouseMoveOutside) {
|
||||||
|
|
Loading…
Reference in New Issue