From 13e65da804f0b94423c20af739e0b53dc3fe91f0 Mon Sep 17 00:00:00 2001
From: ajreckof <66184050+ajreckof@users.noreply.github.com>
Date: Wed, 21 Jun 2023 01:00:37 +0200
Subject: [PATCH] Fix wrong placement of the Make Floating Button.
---
editor/icons/MakeFloating.svg | 2 +-
editor/plugins/script_editor_plugin.cpp | 22 ++++++++++++----------
editor/window_wrapper.cpp | 1 -
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/editor/icons/MakeFloating.svg b/editor/icons/MakeFloating.svg
index 57ccce38eae8..916b1566e9e5 100644
--- a/editor/icons/MakeFloating.svg
+++ b/editor/icons/MakeFloating.svg
@@ -1 +1 @@
-
+
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 51550acb949a..c23a96bede47 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -3999,16 +3999,6 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
menu_hb->add_child(help_search);
help_search->set_tooltip_text(TTR("Search the reference documentation."));
- if (p_wrapper->is_window_available()) {
- make_floating = memnew(ScreenSelect);
- make_floating->set_flat(true);
- make_floating->set_tooltip_text(TTR("Make the script editor floating."));
- make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
-
- menu_hb->add_child(make_floating);
- p_wrapper->connect("window_visibility_changed", callable_mp(this, &ScriptEditor::_window_changed));
- }
-
menu_hb->add_child(memnew(VSeparator));
script_back = memnew(Button);
@@ -4025,6 +4015,18 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
script_forward->set_disabled(true);
script_forward->set_tooltip_text(TTR("Go to next edited document."));
+ if (p_wrapper->is_window_available()) {
+ menu_hb->add_child(memnew(VSeparator));
+
+ make_floating = memnew(ScreenSelect);
+ make_floating->set_flat(true);
+ make_floating->set_tooltip_text(TTR("Make the script editor floating."));
+ make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
+
+ menu_hb->add_child(make_floating);
+ p_wrapper->connect("window_visibility_changed", callable_mp(this, &ScriptEditor::_window_changed));
+ }
+
tab_container->connect("tab_changed", callable_mp(this, &ScriptEditor::_tab_changed));
erase_tab_confirm = memnew(ConfirmationDialog);
diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp
index 21b0a1a21d2e..3a8dbf017fc5 100644
--- a/editor/window_wrapper.cpp
+++ b/editor/window_wrapper.cpp
@@ -432,7 +432,6 @@ void ScreenSelect::pressed() {
}
ScreenSelect::ScreenSelect() {
- set_text(TTR("Make Floating"));
set_tooltip_text(TTR("Make this panel floating.\nRight click to open the screen selector."));
set_button_mask(MouseButtonMask::RIGHT);
set_flat(true);