diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index cf3b375c07..209a69eaaa 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -1,7 +1,7 @@ /* * Copyright (c) 2020, Andreas Kling * Copyright (c) 2021-2022, networkException - * Copyright (c) 2021-2022, Sam Atkins + * Copyright (c) 2021-2023, Sam Atkins * Copyright (c) 2021, Antonio Di Stefano * Copyright (c) 2022, Filiph Sandström * @@ -31,11 +31,11 @@ #include #include #include -#include +#include namespace ThemeEditor { -static const PropertyTab window_tab { +static PropertyTab const window_tab { "Windows"sv, { { "General", @@ -91,7 +91,7 @@ static const PropertyTab window_tab { } }; -static const PropertyTab widgets_tab { +static PropertyTab const widgets_tab { "Widgets"sv, { { "General", @@ -160,7 +160,7 @@ static const PropertyTab widgets_tab { } }; -static const PropertyTab syntax_highlighting_tab { +static PropertyTab const syntax_highlighting_tab { "Syntax Highlighting"sv, { { "General", @@ -184,7 +184,7 @@ static const PropertyTab syntax_highlighting_tab { } }; -static const PropertyTab color_scheme_tab { +static PropertyTab const color_scheme_tab { "Color Scheme"sv, { { "General", @@ -219,6 +219,7 @@ ErrorOr> MainWidget::try_create() TRY(main_widget->load_from_gml(theme_editor_gml)); main_widget->m_preview_widget = main_widget->find_descendant_of_type_named("preview_widget"); main_widget->m_property_tabs = main_widget->find_descendant_of_type_named("property_tabs"); + main_widget->m_statusbar = main_widget->find_descendant_of_type_named("statusbar"); TRY(main_widget->add_property_tab(window_tab)); TRY(main_widget->add_property_tab(widgets_tab)); @@ -234,6 +235,12 @@ MainWidget::MainWidget(NonnullRefPtr alignment_model) : m_current_palette(GUI::Application::the()->palette()) , m_alignment_model(move(alignment_model)) { + GUI::Application::the()->on_action_enter = [this](GUI::Action& action) { + m_statusbar->set_override_text(action.status_tip()); + }; + GUI::Application::the()->on_action_leave = [this](GUI::Action&) { + m_statusbar->set_override_text({}); + }; } ErrorOr MainWidget::initialize_menubar(GUI::Window& window) diff --git a/Userland/Applications/ThemeEditor/MainWidget.h b/Userland/Applications/ThemeEditor/MainWidget.h index 8e7e10e690..e86c946d45 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.h +++ b/Userland/Applications/ThemeEditor/MainWidget.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Sam Atkins + * Copyright (c) 2022-2023, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ @@ -117,6 +117,7 @@ private: RefPtr m_preview_widget; RefPtr m_property_tabs; + RefPtr m_statusbar; RefPtr m_save_action; RefPtr m_theme_override_apply; diff --git a/Userland/Applications/ThemeEditor/ThemeEditor.gml b/Userland/Applications/ThemeEditor/ThemeEditor.gml index 475ae019f2..0fcf4f1021 100644 --- a/Userland/Applications/ThemeEditor/ThemeEditor.gml +++ b/Userland/Applications/ThemeEditor/ThemeEditor.gml @@ -1,44 +1,52 @@ @GUI::Widget { - layout: @GUI::VerticalBoxLayout { - margins: [0, 4, 4] - spacing: 6 - } + layout: @GUI::VerticalBoxLayout {} fill_with_background_color: true @GUI::Widget { - layout: @GUI::HorizontalBoxLayout { - spacing: 4 - } - - @ThemeEditor::PreviewWidget { - name: "preview_widget" - } - - @GUI::TabWidget { - name: "property_tabs" - container_margins: [5] - } - } - - @GUI::Widget { - name: "theme_override_controls" - layout: @GUI::HorizontalBoxLayout { + layout: @GUI::VerticalBoxLayout { + margins: [0, 4, 4] spacing: 6 } - preferred_height: "shrink" - @GUI::Layout::Spacer {} + @GUI::Widget { + layout: @GUI::HorizontalBoxLayout { + spacing: 4 + } - @GUI::DialogButton { - name: "reset_button" - text: "Reset" - enabled: false + @ThemeEditor::PreviewWidget { + name: "preview_widget" + } + + @GUI::TabWidget { + name: "property_tabs" + container_margins: [5] + } } - @GUI::DialogButton { - name: "apply_button" - text: "Apply" - enabled: false + @GUI::Widget { + name: "theme_override_controls" + layout: @GUI::HorizontalBoxLayout { + spacing: 6 + } + preferred_height: "shrink" + + @GUI::Layout::Spacer {} + + @GUI::DialogButton { + name: "reset_button" + text: "Reset" + enabled: false + } + + @GUI::DialogButton { + name: "apply_button" + text: "Apply" + enabled: false + } } } + + @GUI::Statusbar { + name: "statusbar" + } }