diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2022-03-18 22:57:05 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-03 12:21:05 +0200 |
commit | 7e34b88ed406dc38fec5875188bc8f912412a128 (patch) | |
tree | f3a1abcdec4cdab7664d922045bd5bb99972f73d /Userland/DevTools/HackStudio/Debugger | |
parent | 0410414455149ae4622a9600c83e1df6003b3174 (diff) | |
download | serenity-7e34b88ed406dc38fec5875188bc8f912412a128.zip |
LibGUI: Fully support TabWidget in GML
TabWidgets couldn't be used in GML properly, as the GML creation
routines didn't actually call the necessary functions in the TabWidget
to get a new tab added. This commit fixes that by making the name of the
tab a normal property, the previously introduced "title", which can be
trivially set from GML. Therefore, try_add_widget() loses an argument
(while try_add_tab doesn't, because it newly constructs the widget).
This allows us to get rid of the silly "fixing my widget tree after the
fact" code in Help and will make it super easy to use TabWidget in
future GML. :^)
Diffstat (limited to 'Userland/DevTools/HackStudio/Debugger')
-rw-r--r-- | Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp index 4ff7c4148c..a6e1c7aab0 100644 --- a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp @@ -61,8 +61,8 @@ DebugInfoWidget::DebugInfoWidget() m_backtrace_view = splitter.add<GUI::ListView>(); auto& variables_tab_widget = splitter.add<GUI::TabWidget>(); variables_tab_widget.set_tab_position(GUI::TabWidget::TabPosition::Bottom); - variables_tab_widget.add_widget("Variables", build_variables_tab()); - variables_tab_widget.add_widget("Registers", build_registers_tab()); + variables_tab_widget.add_widget(build_variables_tab()); + variables_tab_widget.add_widget(build_registers_tab()); m_backtrace_view->on_selection_change = [this] { const auto& index = m_backtrace_view->selection().first(); @@ -132,6 +132,7 @@ RefPtr<GUI::Menu> DebugInfoWidget::get_context_menu_for_variable(const GUI::Mode NonnullRefPtr<GUI::Widget> DebugInfoWidget::build_variables_tab() { auto variables_widget = GUI::Widget::construct(); + variables_widget->set_title("Variables"); variables_widget->set_layout<GUI::HorizontalBoxLayout>(); m_variables_view = variables_widget->add<GUI::TreeView>(); @@ -148,6 +149,7 @@ NonnullRefPtr<GUI::Widget> DebugInfoWidget::build_variables_tab() NonnullRefPtr<GUI::Widget> DebugInfoWidget::build_registers_tab() { auto registers_widget = GUI::Widget::construct(); + registers_widget->set_title("Registers"); registers_widget->set_layout<GUI::HorizontalBoxLayout>(); m_registers_view = registers_widget->add<GUI::TableView>(); |