Преглед на файлове

Check FLAG_POPUP to close an AcceptDialog when parent is focused

NL преди 2 години
родител
ревизия
a77d8b3eb5
променени са 2 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 0 1
      doc/classes/Window.xml
  2. 1 1
      scene/gui/dialogs.cpp

+ 0 - 1
doc/classes/Window.xml

@@ -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.

+ 1 - 1
scene/gui/dialogs.cpp

@@ -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();
 	}
 }