From 16840057a177144923aacbe91789147b24fdef1e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Tue, 6 Feb 2024 14:59:54 +0100 Subject: [PATCH] Editor: More space and align to right for BehaviorTreeView timings --- editor/debugger/behavior_tree_view.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/editor/debugger/behavior_tree_view.cpp b/editor/debugger/behavior_tree_view.cpp index 3f6de69..e98a557 100644 --- a/editor/debugger/behavior_tree_view.cpp +++ b/editor/debugger/behavior_tree_view.cpp @@ -65,7 +65,7 @@ double BehaviorTreeView::_get_editor_scale() const { if (Engine::get_singleton()->is_editor_hint()) { return EDSCALE; } else { - return 0.0; + return 1.0; } } @@ -103,6 +103,7 @@ void BehaviorTreeView::update_tree(const Ref &p_data) { item->set_custom_font(0, theme_cache.font_custom_name); } + item->set_text_alignment(2, HORIZONTAL_ALIGNMENT_RIGHT); item->set_text(2, rtos(Math::snapped(task_data.elapsed_time, 0.01)).pad_decimals(2)); String cors = (task_data.script_path.is_empty()) ? task_data.type_name : task_data.script_path; @@ -180,9 +181,9 @@ void BehaviorTreeView::_do_update_theme_item_cache() { tree->set_column_clip_content(0, true); tree->set_column_custom_minimum_width(1, 18 * _get_editor_scale()); - Ref font = tree->get_theme_font(LW_NAME(font), LW_NAME(Tree)); - int font_size = tree->get_theme_font_size(LW_NAME(font_size), LW_NAME(Tree)); - int timings_size = font->get_string_size("0.00", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + 12 + extra_spacing; + Ref font = tree->get_theme_font(LW_NAME(font)); + int font_size = tree->get_theme_font_size(LW_NAME(font_size)); + int timings_size = font->get_string_size("00.00", HORIZONTAL_ALIGNMENT_RIGHT, -1, font_size).x + 16 + extra_spacing; tree->set_column_custom_minimum_width(2, timings_size * _get_editor_scale()); }