Skip to content

Commit

Permalink
Merge pull request #78350 from ajreckof/you-know-when-you-want-to-sea…
Browse files Browse the repository at this point in the history
…rch-this-member-you-don't-know-and-then-you-have-the-script-editor-all-over-the-place-now-it-should-not-happen-anymore-hopefully

Fix placement and style of the "Make Floating" button
  • Loading branch information
YuriSizov authored Jun 21, 2023
2 parents 329652b + 13e65da commit 38ae7b5
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 38ae7b5

Please sign in to comment.