summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJulian Murgia - StraToN <the.straton@gmail.com>2016-02-20 02:41:29 +0100
committerJulian Murgia - StraToN <the.straton@gmail.com>2016-02-20 02:45:04 +0100
commit7191de46708126b56fe0db48b9cd1a6fae303889 (patch)
tree6020dfb6a40aa21f13432b29bae10182247d8eb4 /tools/editor
parent11c241abd7c3c363747cf2e3faa9467dbbd89449 (diff)
Added a setting in editor defining scene tabs close button policy. Fixes #3777
global/always_show_close_button_in_scene_tabs Default = OFF --> Close button only on active tab ON --> Close button on all tabs
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/editor_node.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 227ce24aa5..7fa85c4476 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -380,6 +380,10 @@ void EditorNode::_notification(int p_what) {
_menu_option_confirm(FILE_QUIT, false);
};
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
+ }
+
}
void EditorNode::_fs_changed() {
@@ -5059,7 +5063,7 @@ EditorNode::EditorNode() {
scene_tabs=memnew( Tabs );
scene_tabs->add_tab("unsaved");
scene_tabs->set_tab_align(Tabs::ALIGN_CENTER);
- scene_tabs->set_tab_close_display_policy(Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY);
+ scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) );
scene_tabs->connect("tab_changed",this,"_scene_tab_changed");
scene_tabs->connect("right_button_pressed",this,"_scene_tab_script_edited");
scene_tabs->connect("tab_close", this, "_scene_tab_closed");