summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-07-04 00:13:28 -0300
committerreduz <reduzio@gmail.com>2021-07-04 13:13:53 -0300
commitf4379cbc82cfe915e97a8e879567b820a10198f4 (patch)
tree92cae1389f40b23c1bac667e29c03295e63ad788 /editor
parent5c3055e0fe363e08e8cdd3f922313ec9dacfaf43 (diff)
Clean up Tree
Fixes some problems introduced by #49917 * Tree used minimum size as a stretch ratio, so it forced a minimum size of 1. * Minimum size redone, stretch ratio moved to a separate setting * Fitting to contents was enforced, this is more intuitive, but in many situations this is undesired. * Added a clip content option for situations where fit to contents does not apply. * Icon would scroll with the item, making it invislbe if the item is too long. * Made icon always appear to the right (or left if RTL is enabled) of the visible item space.
Diffstat (limited to 'editor')
-rw-r--r--editor/action_map_editor.cpp1
-rw-r--r--editor/debugger/editor_network_profiler.cpp5
-rw-r--r--editor/debugger/editor_profiler.cpp9
-rw-r--r--editor/debugger/editor_visual_profiler.cpp3
-rw-r--r--editor/debugger/script_editor_debugger.cpp2
-rw-r--r--editor/dependency_editor.cpp8
-rw-r--r--editor/editor_autoload_settings.cpp8
-rw-r--r--editor/editor_help_search.cpp2
-rw-r--r--editor/editor_plugin_settings.cpp5
-rw-r--r--editor/localization_editor.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp6
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp6
-rw-r--r--editor/plugins/theme_editor_plugin.cpp3
13 files changed, 47 insertions, 13 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp
index fe1401bdf9..7ed603410d 100644
--- a/editor/action_map_editor.cpp
+++ b/editor/action_map_editor.cpp
@@ -1123,6 +1123,7 @@ ActionMapEditor::ActionMapEditor() {
action_tree->set_hide_root(true);
action_tree->set_column_titles_visible(true);
action_tree->set_column_title(0, TTR("Action"));
+ action_tree->set_column_clip_content(0, true);
action_tree->set_column_title(1, TTR("Deadzone"));
action_tree->set_column_expand(1, false);
action_tree->set_column_custom_minimum_width(1, 80 * EDSCALE);
diff --git a/editor/debugger/editor_network_profiler.cpp b/editor/debugger/editor_network_profiler.cpp
index af83baeff8..1c781c4d98 100644
--- a/editor/debugger/editor_network_profiler.cpp
+++ b/editor/debugger/editor_network_profiler.cpp
@@ -178,18 +178,23 @@ EditorNetworkProfiler::EditorNetworkProfiler() {
counters_display->set_column_titles_visible(true);
counters_display->set_column_title(0, TTR("Node"));
counters_display->set_column_expand(0, true);
+ counters_display->set_column_clip_content(0, true);
counters_display->set_column_custom_minimum_width(0, 60 * EDSCALE);
counters_display->set_column_title(1, TTR("Incoming RPC"));
counters_display->set_column_expand(1, false);
+ counters_display->set_column_clip_content(1, true);
counters_display->set_column_custom_minimum_width(1, 120 * EDSCALE);
counters_display->set_column_title(2, TTR("Incoming RSET"));
counters_display->set_column_expand(2, false);
+ counters_display->set_column_clip_content(2, true);
counters_display->set_column_custom_minimum_width(2, 120 * EDSCALE);
counters_display->set_column_title(3, TTR("Outgoing RPC"));
counters_display->set_column_expand(3, false);
+ counters_display->set_column_clip_content(3, true);
counters_display->set_column_custom_minimum_width(3, 120 * EDSCALE);
counters_display->set_column_title(4, TTR("Outgoing RSET"));
counters_display->set_column_expand(4, false);
+ counters_display->set_column_clip_content(4, true);
counters_display->set_column_custom_minimum_width(4, 120 * EDSCALE);
add_child(counters_display);
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index ba84040b0c..5f4d1b6f36 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -631,13 +631,16 @@ EditorProfiler::EditorProfiler() {
variables->set_column_titles_visible(true);
variables->set_column_title(0, TTR("Name"));
variables->set_column_expand(0, true);
- variables->set_column_custom_minimum_width(0, 60 * EDSCALE);
+ variables->set_column_clip_content(0, true);
+ variables->set_column_expand_ratio(0, 60);
variables->set_column_title(1, TTR("Time"));
variables->set_column_expand(1, false);
- variables->set_column_custom_minimum_width(1, 100 * EDSCALE);
+ variables->set_column_clip_content(1, true);
+ variables->set_column_expand_ratio(1, 100);
variables->set_column_title(2, TTR("Calls"));
variables->set_column_expand(2, false);
- variables->set_column_custom_minimum_width(2, 60 * EDSCALE);
+ variables->set_column_clip_content(2, true);
+ variables->set_column_expand_ratio(2, 60);
variables->connect("item_edited", callable_mp(this, &EditorProfiler::_item_edited));
graph = memnew(TextureRect);
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index 171d0574e0..a0e8a3bd35 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/editor/debugger/editor_visual_profiler.cpp
@@ -773,12 +773,15 @@ EditorVisualProfiler::EditorVisualProfiler() {
variables->set_column_titles_visible(true);
variables->set_column_title(0, TTR("Name"));
variables->set_column_expand(0, true);
+ variables->set_column_clip_content(0, true);
variables->set_column_custom_minimum_width(0, 60);
variables->set_column_title(1, TTR("CPU"));
variables->set_column_expand(1, false);
+ variables->set_column_clip_content(1, true);
variables->set_column_custom_minimum_width(1, 60 * EDSCALE);
variables->set_column_title(2, TTR("GPU"));
variables->set_column_expand(2, false);
+ variables->set_column_clip_content(2, true);
variables->set_column_custom_minimum_width(2, 60 * EDSCALE);
variables->connect("cell_selected", callable_mp(this, &EditorVisualProfiler::_item_selected));
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 0d3fd8c7f6..b877ab030f 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -1644,8 +1644,10 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
error_tree->set_column_expand(0, false);
error_tree->set_column_custom_minimum_width(0, 140);
+ error_tree->set_column_clip_content(0, true);
error_tree->set_column_expand(1, true);
+ error_tree->set_column_clip_content(1, true);
error_tree->set_select_mode(Tree::SELECT_ROW);
error_tree->set_hide_root(true);
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 74a8ad9077..ef571e5c7a 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -226,7 +226,11 @@ DependencyEditor::DependencyEditor() {
tree->set_columns(2);
tree->set_column_titles_visible(true);
tree->set_column_title(0, TTR("Resource"));
+ tree->set_column_clip_content(0, true);
+ tree->set_column_expand_ratio(0, 2);
tree->set_column_title(1, TTR("Path"));
+ tree->set_column_clip_content(1, true);
+ tree->set_column_expand_ratio(1, 1);
tree->set_hide_root(true);
tree->connect("button_pressed", callable_mp(this, &DependencyEditor::_load_pressed));
@@ -769,9 +773,11 @@ OrphanResourcesDialog::OrphanResourcesDialog() {
files = memnew(Tree);
files->set_columns(2);
files->set_column_titles_visible(true);
- files->set_column_custom_minimum_width(1, 100);
+ files->set_column_custom_minimum_width(1, 100 * EDSCALE);
files->set_column_expand(0, true);
+ files->set_column_clip_content(0, true);
files->set_column_expand(1, false);
+ files->set_column_clip_content(1, true);
files->set_column_title(0, TTR("Resource"));
files->set_column_title(1, TTR("Owns"));
files->set_hide_root(true);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 306a88047a..12ae55fbc1 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -882,19 +882,17 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
tree->set_column_title(0, TTR("Name"));
tree->set_column_expand(0, true);
- tree->set_column_custom_minimum_width(0, 100 * EDSCALE);
+ tree->set_column_expand_ratio(0, 1);
tree->set_column_title(1, TTR("Path"));
tree->set_column_expand(1, true);
- tree->set_column_custom_minimum_width(1, 100 * EDSCALE);
+ tree->set_column_clip_content(1, true);
+ tree->set_column_expand_ratio(1, 2);
tree->set_column_title(2, TTR("Global Variable"));
tree->set_column_expand(2, false);
- // Reserve enough space for translations of "Global Variable" which may be longer.
- tree->set_column_custom_minimum_width(2, 150 * EDSCALE);
tree->set_column_expand(3, false);
- tree->set_column_custom_minimum_width(3, 120 * EDSCALE);
tree->connect("cell_selected", callable_mp(this, &EditorAutoloadSettings::_autoload_selected));
tree->connect("item_edited", callable_mp(this, &EditorAutoloadSettings::_autoload_edited));
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index 57ddc64e95..a9bbb92079 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -237,9 +237,11 @@ EditorHelpSearch::EditorHelpSearch() {
results_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
results_tree->set_columns(2);
results_tree->set_column_title(0, TTR("Name"));
+ results_tree->set_column_clip_content(0, true);
results_tree->set_column_title(1, TTR("Member Type"));
results_tree->set_column_expand(1, false);
results_tree->set_column_custom_minimum_width(1, 150 * EDSCALE);
+ results_tree->set_column_clip_content(1, true);
results_tree->set_custom_minimum_size(Size2(0, 100) * EDSCALE);
results_tree->set_hide_root(true);
results_tree->set_select_mode(Tree::SELECT_ROW);
diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp
index 62fbad7bcf..b4e5a58c21 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -212,10 +212,15 @@ EditorPluginSettings::EditorPluginSettings() {
plugin_list->set_column_title(3, TTR("Status:"));
plugin_list->set_column_title(4, TTR("Edit:"));
plugin_list->set_column_expand(0, true);
+ plugin_list->set_column_clip_content(0, true);
plugin_list->set_column_expand(1, false);
+ plugin_list->set_column_clip_content(1, true);
plugin_list->set_column_expand(2, false);
+ plugin_list->set_column_clip_content(2, true);
plugin_list->set_column_expand(3, false);
+ plugin_list->set_column_clip_content(3, true);
plugin_list->set_column_expand(4, false);
+ plugin_list->set_column_clip_content(4, true);
plugin_list->set_column_custom_minimum_width(1, 100 * EDSCALE);
plugin_list->set_column_custom_minimum_width(2, 250 * EDSCALE);
plugin_list->set_column_custom_minimum_width(3, 80 * EDSCALE);
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index 91a15f1131..208d4437d3 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -728,7 +728,9 @@ LocalizationEditor::LocalizationEditor() {
translation_remap_options->set_column_title(1, TTR("Locale"));
translation_remap_options->set_column_titles_visible(true);
translation_remap_options->set_column_expand(0, true);
+ translation_remap_options->set_column_clip_content(0, true);
translation_remap_options->set_column_expand(1, false);
+ translation_remap_options->set_column_clip_content(1, true);
translation_remap_options->set_column_custom_minimum_width(1, 200);
translation_remap_options->connect("item_edited", callable_mp(this, &LocalizationEditor::_translation_res_option_changed));
translation_remap_options->connect("button_pressed", callable_mp(this, &LocalizationEditor::_translation_res_option_delete));
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 48d7cfdee2..2b92943f7e 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -569,8 +569,10 @@ void AnimationPlayerEditor::_animation_blend() {
blend_editor.dialog->popup_centered(Size2(400, 400) * EDSCALE);
blend_editor.tree->set_hide_root(true);
- blend_editor.tree->set_column_custom_minimum_width(0, 10);
- blend_editor.tree->set_column_custom_minimum_width(1, 3);
+ blend_editor.tree->set_column_expand_ratio(0, 10);
+ blend_editor.tree->set_column_clip_content(0, true);
+ blend_editor.tree->set_column_expand_ratio(1, 3);
+ blend_editor.tree->set_column_clip_content(1, true);
List<StringName> anims;
player->get_animation_list(&anims);
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index a7c11f8521..488aa8c861 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -367,8 +367,10 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() {
tree = memnew(Tree);
tree->connect("button_pressed", callable_mp(this, &ResourcePreloaderEditor::_cell_button_pressed));
tree->set_columns(2);
- tree->set_column_custom_minimum_width(0, 2);
- tree->set_column_custom_minimum_width(1, 3);
+ tree->set_column_expand_ratio(0, 2);
+ tree->set_column_clip_content(0, true);
+ tree->set_column_expand_ratio(1, 3);
+ tree->set_column_clip_content(1, true);
tree->set_column_expand(0, true);
tree->set_column_expand(1, true);
tree->set_v_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index 99d7267eac..be1aeb309f 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -930,11 +930,14 @@ ThemeItemImportTree::ThemeItemImportTree() {
import_items_tree->set_column_title(IMPORT_ITEM, TTR("Import"));
import_items_tree->set_column_title(IMPORT_ITEM_DATA, TTR("With Data"));
import_items_tree->set_column_expand(0, true);
+ import_items_tree->set_column_clip_content(0, true);
import_items_tree->set_column_expand(IMPORT_ITEM, false);
import_items_tree->set_column_expand(IMPORT_ITEM_DATA, false);
import_items_tree->set_column_custom_minimum_width(0, 160 * EDSCALE);
import_items_tree->set_column_custom_minimum_width(IMPORT_ITEM, 80 * EDSCALE);
import_items_tree->set_column_custom_minimum_width(IMPORT_ITEM_DATA, 80 * EDSCALE);
+ import_items_tree->set_column_clip_content(1, true);
+ import_items_tree->set_column_clip_content(2, true);
ScrollContainer *import_bulk_sc = memnew(ScrollContainer);
import_bulk_sc->set_custom_minimum_size(Size2(260.0, 0.0) * EDSCALE);