Skip to content

Commit

Permalink
Show opened script or help name
Browse files Browse the repository at this point in the history
  • Loading branch information
volzhs authored and malcolmhoward committed Jul 31, 2018
1 parent ba3f978 commit 5748fcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1542,18 +1542,18 @@ void ScriptEditor::_update_members_overview_visibility() {

ScriptEditorBase *se = _get_current_editor();
if (!se) {
members_overview_buttons_hbox->set_visible(false);
members_overview_alphabeta_sort_button->set_visible(false);
members_overview->set_visible(false);
overview_vbox->set_visible(false);
return;
}

if (members_overview_enabled && se->show_members_overview()) {
members_overview_buttons_hbox->set_visible(true);
members_overview_alphabeta_sort_button->set_visible(true);
members_overview->set_visible(true);
overview_vbox->set_visible(true);
} else {
members_overview_buttons_hbox->set_visible(false);
members_overview_alphabeta_sort_button->set_visible(false);
members_overview->set_visible(false);
overview_vbox->set_visible(false);
}
Expand Down Expand Up @@ -1582,7 +1582,7 @@ void ScriptEditor::_update_members_overview() {
members_overview->set_item_metadata(i, functions[i].get_slice(":", 1).to_int() - 1);
}

String path = se->get_edited_resource()->get_path();
String path = se->get_edited_script()->get_path();
bool built_in = !path.is_resource_file();
String name = built_in ? path.get_file() : se->get_name();
filename->set_text(name);
Expand All @@ -1604,9 +1604,8 @@ void ScriptEditor::_update_help_overview_visibility() {
}

if (help_overview_enabled) {
members_overview_buttons_hbox->set_visible(false);
members_overview_alphabeta_sort_button->set_visible(false);
help_overview->set_visible(true);
overview_vbox->set_visible(true);
filename->set_text(se->get_name());
} else {
help_overview->set_visible(false);
Expand Down Expand Up @@ -2946,6 +2945,12 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
members_overview_buttons_hbox = memnew(HBoxContainer);
members_overview_vbox->add_child(members_overview_buttons_hbox);

filename = memnew(Label);
filename->set_clip_text(true);
filename->set_h_size_flags(SIZE_EXPAND_FILL);
filename->add_style_override("normal", EditorNode::get_singleton()->get_gui_base()->get_stylebox("normal", "LineEdit"));
members_overview_buttons_hbox->add_child(filename);

members_overview_alphabeta_sort_button = memnew(ToolButton);
members_overview_alphabeta_sort_button->set_tooltip(TTR("Toggle alphabetical sorting of the method list."));
members_overview_alphabeta_sort_button->set_toggle_mode(true);
Expand Down
1 change: 1 addition & 0 deletions editor/plugins/script_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ class ScriptEditor : public PanelContainer {
ItemList *members_overview;
VBoxContainer *members_overview_vbox;
HBoxContainer *members_overview_buttons_hbox;
Label *filename;
ToolButton *members_overview_alphabeta_sort_button;
bool members_overview_enabled;
ItemList *help_overview;
Expand Down

0 comments on commit 5748fcd

Please sign in to comment.