From 2ed4ed8cd0b0e770bc8d7612338be680c727060d Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 24 Apr 2025 22:52:27 +0200 Subject: [PATCH] Improve Window's _validate_property() --- scene/main/window.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index c145ddc6aa..27afd864ad 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -236,15 +236,15 @@ void Window::_get_property_list(List *p_list) const { } void Window::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "position" && initial_position != WINDOW_INITIAL_POSITION_ABSOLUTE) { - p_property.usage = PROPERTY_USAGE_NONE; - } - - if (p_property.name == "current_screen" && initial_position != WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN) { - p_property.usage = PROPERTY_USAGE_NONE; - } - - if (p_property.name == "theme_type_variation") { + if (p_property.name == "position") { + if (initial_position != WINDOW_INITIAL_POSITION_ABSOLUTE) { + p_property.usage = PROPERTY_USAGE_NONE; + } + } else if (p_property.name == "current_screen") { + if (initial_position != WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN) { + p_property.usage = PROPERTY_USAGE_NONE; + } + } else if (p_property.name == "theme_type_variation") { List names; // Only the default theme and the project theme are used for the list of options.