From 3718a16f5903ebacaa5043c9dd477251a17f35b6 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 14 Jan 2021 00:09:44 +0100 Subject: [PATCH] CrashReporter: Put backtrace TextEditor in a TabWidget Since CrashReporter will be showing more info from coredumps soon, we need tabs to put those things somewhere! :^) --- .../CrashReporter/CrashReporterWindow.gml | 17 ++--------------- Userland/Applications/CrashReporter/main.cpp | 6 +++++- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Userland/Applications/CrashReporter/CrashReporterWindow.gml b/Userland/Applications/CrashReporter/CrashReporterWindow.gml index acca32bd13..ed7c942ff5 100644 --- a/Userland/Applications/CrashReporter/CrashReporterWindow.gml +++ b/Userland/Applications/CrashReporter/CrashReporterWindow.gml @@ -58,21 +58,8 @@ } } - @GUI::Widget { - fixed_height: 18 - - layout: @GUI::HorizontalBoxLayout { - } - - @GUI::Label { - text: "Backtrace:" - text_alignment: "CenterLeft" - } - } - - @GUI::TextEditor { - name: "backtrace_text_editor" - mode: "ReadOnly" + @GUI::TabWidget { + name: "tab_widget" } @GUI::Widget { diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 668ccd234c..1676e1df56 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -163,7 +164,10 @@ int main(int argc, char** argv) Desktop::Launcher::open(URL::create_with_file_protocol(LexicalPath(coredump_path).dirname())); }; - auto& backtrace_text_editor = *widget.find_descendant_of_type_named("backtrace_text_editor"); + auto& tab_widget = *widget.find_descendant_of_type_named("tab_widget"); + + auto& backtrace_text_editor = tab_widget.add_tab("Backtrace"); + backtrace_text_editor.set_mode(GUI::TextEditor::Mode::ReadOnly); backtrace_text_editor.set_text(backtrace); backtrace_text_editor.set_should_hide_unnecessary_scrollbars(true);