Skip to content

Commit

Permalink
Fix wrong placement of the Make Floating Button.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreckof committed Jun 20, 2023
1 parent c0d8d91 commit 13e65da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion editor/icons/MakeFloating.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion editor/window_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13e65da

Please sign in to comment.