diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2022-02-03 02:45:31 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2022-03-09 01:48:18 -0300 |
commit | 182e038af50f1c2edf33d4880fdcc93792946d4c (patch) | |
tree | de5ffc7bd30f147095bcae65bf25eec4a9d5070f /editor | |
parent | f73ef03a86912dfe5c6eb73a99c3f50c144c5030 (diff) |
Replace `TabBar`'s `min_width` with `max_tab_width` and expose it
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 12 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 3 |
2 files changed, 3 insertions, 12 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 42eaf8bd89..9f3d083bf1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -725,11 +725,7 @@ void EditorNode::_notification(int p_what) { help_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("MenuHover"), SNAME("EditorStyles"))); } - if (EDITOR_GET("interface/scene_tabs/resize_if_many_tabs")) { - scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); - } else { - scene_tabs->set_min_width(0); - } + scene_tabs->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE); _update_scene_tabs(); recent_scenes->reset_size(); @@ -807,10 +803,6 @@ void EditorNode::_notification(int p_what) { _update_update_spinner(); } break; - - case Control::NOTIFICATION_RESIZED: { - _update_scene_tabs(); - } break; } } @@ -6255,7 +6247,7 @@ EditorNode::EditorNode() { scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); scene_tabs->set_tab_close_display_policy((bool(EDITOR_GET("interface/scene_tabs/always_show_close_button")) ? TabBar::CLOSE_BUTTON_SHOW_ALWAYS : TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); - scene_tabs->set_min_width(int(EDITOR_GET("interface/scene_tabs/minimum_width")) * EDSCALE); + scene_tabs->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE); scene_tabs->set_drag_to_rearrange_enabled(true); scene_tabs->connect("tab_changed", callable_mp(this, &EditorNode::_scene_tab_changed)); scene_tabs->connect("tab_button_pressed", callable_mp(this, &EditorNode::_scene_tab_script_edited)); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 52ff7e3c19..45685b8fb2 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -461,8 +461,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Scene tabs _initial_set("interface/scene_tabs/show_thumbnail_on_hover", true); - _initial_set("interface/scene_tabs/resize_if_many_tabs", true); - EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/scene_tabs/minimum_width", 50, "50,500,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) + EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_RANGE, "interface/scene_tabs/maximum_width", 350, "0,9999,1", PROPERTY_USAGE_DEFAULT) _initial_set("interface/scene_tabs/show_script_button", false); /* Filesystem */ |