diff options
author | Nathan Franke <natfra@pm.me> | 2021-11-24 20:58:47 -0600 |
---|---|---|
committer | Nathan Franke <natfra@pm.me> | 2021-12-09 01:38:46 -0600 |
commit | 41a20171eb81a7850dd96ec31da4b40c619538a2 (patch) | |
tree | 64df686faeeca6068ba43167bf07fe8b3823e417 /editor/debugger | |
parent | f1e3c87244f18ab1a507b6e3637c34b2d49c1dc6 (diff) |
align to horizontal_alignment, valign to vertical_alignment, related
Diffstat (limited to 'editor/debugger')
-rw-r--r-- | editor/debugger/editor_debugger_node.cpp | 2 | ||||
-rw-r--r-- | editor/debugger/editor_network_profiler.cpp | 6 | ||||
-rw-r--r-- | editor/debugger/editor_performance_profiler.cpp | 14 | ||||
-rw-r--r-- | editor/debugger/editor_profiler.cpp | 2 | ||||
-rw-r--r-- | editor/debugger/editor_visual_profiler.cpp | 8 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 10 |
6 files changed, 21 insertions, 21 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 85cf1558fe..8ea028a7de 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -59,7 +59,7 @@ EditorDebuggerNode::EditorDebuggerNode() { add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); tabs = memnew(TabContainer); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->set_tabs_visible(false); tabs->connect("tab_changed", callable_mp(this, &EditorDebuggerNode::_debugger_changed)); add_child(tabs); diff --git a/editor/debugger/editor_network_profiler.cpp b/editor/debugger/editor_network_profiler.cpp index d4385630be..8b1f0085d5 100644 --- a/editor/debugger/editor_network_profiler.cpp +++ b/editor/debugger/editor_network_profiler.cpp @@ -60,7 +60,7 @@ void EditorNetworkProfiler::_update_frame() { TreeItem *node = counters_display->create_item(root); for (int j = 0; j < counters_display->get_columns(); ++j) { - node->set_text_align(j, j > 0 ? TreeItem::ALIGN_RIGHT : TreeItem::ALIGN_LEFT); + node->set_text_alignment(j, j > 0 ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT); } node->set_text(0, E.value.node_path); @@ -149,7 +149,7 @@ EditorNetworkProfiler::EditorNetworkProfiler() { incoming_bandwidth_text = memnew(LineEdit); incoming_bandwidth_text->set_editable(false); incoming_bandwidth_text->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - incoming_bandwidth_text->set_align(LineEdit::Align::ALIGN_RIGHT); + incoming_bandwidth_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); hb->add_child(incoming_bandwidth_text); Control *down_up_spacer = memnew(Control); @@ -163,7 +163,7 @@ EditorNetworkProfiler::EditorNetworkProfiler() { outgoing_bandwidth_text = memnew(LineEdit); outgoing_bandwidth_text->set_editable(false); outgoing_bandwidth_text->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - outgoing_bandwidth_text->set_align(LineEdit::Align::ALIGN_RIGHT); + outgoing_bandwidth_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); hb->add_child(outgoing_bandwidth_text); // Set initial texts in the incoming/outgoing bandwidth labels diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 952f46e9a5..6106f1755d 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -132,14 +132,14 @@ void EditorPerformanceProfiler::_monitor_draw() { rect.size -= graph_style_box->get_minimum_size(); Color draw_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")); draw_color.set_hsv(Math::fmod(hue_shift * float(current.frame_index), 0.9f), draw_color.get_s() * 0.9f, draw_color.get_v() * value_multiplier, 0.6f); - monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HALIGN_LEFT, rect.size.x, font_size, draw_color); + monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); draw_color.a = 0.9f; float value_position = rect.size.width - graph_font->get_string_size(current.item->get_text(1), font_size).width; if (value_position < 0) { value_position = 0; } - monitor_draw->draw_string(graph_font, rect.position + Point2(value_position, graph_font->get_ascent(font_size)), current.item->get_text(1), HALIGN_LEFT, rect.size.x, font_size, draw_color); + monitor_draw->draw_string(graph_font, rect.position + Point2(value_position, graph_font->get_ascent(font_size)), current.item->get_text(1), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); rect.position.y += graph_font->get_height(font_size); rect.size.height -= graph_font->get_height(font_size); @@ -152,12 +152,12 @@ void EditorPerformanceProfiler::_monitor_draw() { Color horizontal_line_color; horizontal_line_color.set_hsv(draw_color.get_h(), draw_color.get_s() * 0.5f, draw_color.get_v() * 0.5f, 0.3f); monitor_draw->draw_line(rect.position, rect.position + Vector2(rect.size.width, 0), horizontal_line_color, Math::round(EDSCALE)); - monitor_draw->draw_string(graph_font, rect.position + Vector2(0, graph_font->get_ascent(font_size)), _create_label(current.max, current.type), HALIGN_LEFT, rect.size.width, font_size, horizontal_line_color); + monitor_draw->draw_string(graph_font, rect.position + Vector2(0, graph_font->get_ascent(font_size)), _create_label(current.max, current.type), HORIZONTAL_ALIGNMENT_LEFT, rect.size.width, font_size, horizontal_line_color); for (int j = 0; j < line_count; j++) { Vector2 y_offset = Vector2(0, rect.size.height * (1.0f - float(j) / float(line_count))); monitor_draw->draw_line(rect.position + y_offset, rect.position + Vector2(rect.size.width, 0) + y_offset, horizontal_line_color, Math::round(EDSCALE)); - monitor_draw->draw_string(graph_font, rect.position - Vector2(0, graph_font->get_descent(font_size)) + y_offset, _create_label(current.max * float(j) / float(line_count), current.type), HALIGN_LEFT, rect.size.width, font_size, horizontal_line_color); + monitor_draw->draw_string(graph_font, rect.position - Vector2(0, graph_font->get_descent(font_size)) + y_offset, _create_label(current.max * float(j) / float(line_count), current.type), HORIZONTAL_ALIGNMENT_LEFT, rect.size.width, font_size, horizontal_line_color); } } @@ -191,7 +191,7 @@ void EditorPerformanceProfiler::_monitor_draw() { if (text_top_left_position.y < 0) { text_top_left_position.y = h2 + MARKER_MARGIN; } - monitor_draw->draw_string(graph_font, rect.position + text_top_left_position + Point2(0, graph_font->get_ascent(font_size)), label, HALIGN_LEFT, rect.size.x, font_size, line_color); + monitor_draw->draw_string(graph_font, rect.position + text_top_left_position + Point2(0, graph_font->get_ascent(font_size)), label, HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, line_color); } prev = h2; e = e->next(); @@ -378,8 +378,8 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() { info_message = memnew(Label); info_message->set_text(TTR("Pick one or more items from the list to display the graph.")); - info_message->set_valign(Label::VALIGN_CENTER); - info_message->set_align(Label::ALIGN_CENTER); + info_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); info_message->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index d08ae1de8a..2bdacb51b8 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -355,7 +355,7 @@ void EditorProfiler::_update_frame() { item->set_metadata(0, it.signature); item->set_metadata(1, it.script); item->set_metadata(2, it.line); - item->set_text_align(2, TreeItem::ALIGN_RIGHT); + item->set_text_alignment(2, HORIZONTAL_ALIGNMENT_RIGHT); item->set_tooltip(0, it.name + "\n" + it.script + ":" + itos(it.line)); float time = dtime == DISPLAY_SELF_TIME ? it.self : it.total; diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 4739458f8e..a4e4ed4020 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -462,7 +462,7 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(0, frame_y), Vector2(half_width, frame_y), Color(1, 1, 1, 0.3)); String limit_str = String::num(graph_limit, 2); - graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); + graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); } if (graph_height_gpu > 0) { @@ -473,11 +473,11 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(half_width, frame_y), Vector2(graph->get_size().x, frame_y), Color(1, 1, 1, 0.3)); String limit_str = String::num(graph_limit, 2); - graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); + graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); } - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); + graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); + graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); /* if (hover_metric != -1 && frame_metrics[hover_metric].valid) { diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index bcff9cc56a..71e501056c 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -499,7 +499,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da error->set_icon(0, get_theme_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); error->set_text(0, time); - error->set_text_align(0, TreeItem::ALIGN_LEFT); + error->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); const Color color = get_theme_color(oe.warning ? SNAME("warning_color") : SNAME("error_color"), SNAME("Editor")); error->set_custom_color(0, color); @@ -524,7 +524,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *cpp_cond = error_tree->create_item(error); cpp_cond->set_text(0, "<" + TTR("C++ Error") + ">"); cpp_cond->set_text(1, oe.error); - cpp_cond->set_text_align(0, TreeItem::ALIGN_LEFT); + cpp_cond->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); tooltip += TTR("C++ Error:") + " " + oe.error + "\n"; if (source_is_project_file) { cpp_cond->set_metadata(0, source_meta); @@ -542,7 +542,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *cpp_source = error_tree->create_item(error); cpp_source->set_text(0, "<" + (source_is_project_file ? TTR("Source") : TTR("C++ Source")) + ">"); cpp_source->set_text(1, source_txt); - cpp_source->set_text_align(0, TreeItem::ALIGN_LEFT); + cpp_source->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); tooltip += (source_is_project_file ? TTR("Source:") : TTR("C++ Source:")) + " " + source_txt + "\n"; // Set metadata to highlight error line in scripts. @@ -565,7 +565,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da if (i == 0) { stack_trace->set_text(0, "<" + TTR("Stack Trace") + ">"); - stack_trace->set_text_align(0, TreeItem::ALIGN_LEFT); + stack_trace->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); error->set_metadata(0, meta); tooltip += TTR("Stack Trace:") + "\n"; } @@ -1574,7 +1574,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { editor = p_editor; tabs = memnew(TabContainer); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed)); |