summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-26 23:03:31 +0200
committerGitHub <noreply@github.com>2022-08-26 23:03:31 +0200
commit4f60fd04809490ef46e43936bfe7f28a5e97830b (patch)
tree8a009dd5d5d887079990cb615a37aed1948e9bc2 /scene
parentee461b7295c2e6736994ef33c3ace67355a674f8 (diff)
parentbc4ba6cb78b3815dbc61f220c406974c1c518dc5 (diff)
Merge pull request #64777 from bruvzg/extend_to_title
[macOS] Extend editor contents to the window title bar for better space usage.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/menu_bar.cpp7
-rw-r--r--scene/main/window.cpp2
-rw-r--r--scene/main/window.h1
3 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp
index f450222130..9eba2feaf7 100644
--- a/scene/gui/menu_bar.cpp
+++ b/scene/gui/menu_bar.cpp
@@ -276,10 +276,7 @@ void MenuBar::_update_submenu(const String &p_menu_name, PopupMenu *p_child) {
}
bool MenuBar::is_native_menu() const {
- if (!is_visible_in_tree()) {
- return false;
- }
- if (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root()->is_ancestor_of(this) || get_tree()->get_edited_scene_root() == this)) {
+ if (Engine::get_singleton()->is_editor_hint() && is_inside_tree() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root()->is_ancestor_of(this) || get_tree()->get_edited_scene_root() == this)) {
return false;
}
@@ -308,7 +305,7 @@ void MenuBar::_clear_menu() {
void MenuBar::_update_menu() {
_clear_menu();
- if (!is_inside_tree()) {
+ if (!is_visible_in_tree()) {
return;
}
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 35414da9ed..1b7aa787e7 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -1685,6 +1685,7 @@ void Window::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "transparent"), "set_flag", "get_flag", FLAG_TRANSPARENT);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "unfocusable"), "set_flag", "get_flag", FLAG_NO_FOCUS);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "popup_window"), "set_flag", "get_flag", FLAG_POPUP);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "extend_to_title"), "set_flag", "get_flag", FLAG_EXTEND_TO_TITLE);
ADD_GROUP("Limits", "");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "min_size", PROPERTY_HINT_NONE, "suffix:px"), "set_min_size", "get_min_size");
@@ -1730,6 +1731,7 @@ void Window::_bind_methods() {
BIND_ENUM_CONSTANT(FLAG_TRANSPARENT);
BIND_ENUM_CONSTANT(FLAG_NO_FOCUS);
BIND_ENUM_CONSTANT(FLAG_POPUP);
+ BIND_ENUM_CONSTANT(FLAG_EXTEND_TO_TITLE);
BIND_ENUM_CONSTANT(FLAG_MAX);
BIND_ENUM_CONSTANT(CONTENT_SCALE_MODE_DISABLED);
diff --git a/scene/main/window.h b/scene/main/window.h
index 4146390e97..a5b6b26104 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -56,6 +56,7 @@ public:
FLAG_TRANSPARENT = DisplayServer::WINDOW_FLAG_TRANSPARENT,
FLAG_NO_FOCUS = DisplayServer::WINDOW_FLAG_NO_FOCUS,
FLAG_POPUP = DisplayServer::WINDOW_FLAG_POPUP,
+ FLAG_EXTEND_TO_TITLE = DisplayServer::WINDOW_FLAG_EXTEND_TO_TITLE,
FLAG_MAX = DisplayServer::WINDOW_FLAG_MAX,
};