mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Check FLAG_POPUP to close an AcceptDialog when parent is focused
This commit is contained in:
parent
349e44091d
commit
a77d8b3eb5
@ -626,7 +626,6 @@
|
||||
</member>
|
||||
<member name="popup_window" type="bool" setter="set_flag" getter="get_flag" default="false">
|
||||
If [code]true[/code], the [Window] will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless [member exclusive] is enabled).
|
||||
[b]Note:[/b] This property only works with native windows.
|
||||
</member>
|
||||
<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
|
||||
The window's position in pixels.
|
||||
|
@ -45,7 +45,7 @@ void AcceptDialog::_input_from_window(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
|
||||
void AcceptDialog::_parent_focused() {
|
||||
if (close_on_escape && !is_exclusive()) {
|
||||
if (!is_exclusive() && get_flag(FLAG_POPUP)) {
|
||||
_cancel_pressed();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user