diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp index fed6a9d0af..30cb85d955 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.cpp +++ b/Userland/Libraries/LibGUI/AboutDialog.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include @@ -24,8 +24,8 @@ NonnullRefPtr AboutDialog::create(String const& name, String versio auto dialog = adopt_ref(*new AboutDialog(name, version, icon, parent_window)); dialog->set_title(ByteString::formatted("About {}", name)); - auto widget = dialog->set_main_widget(); - MUST(widget->load_from_gml(about_dialog_gml)); + auto widget = AboutDialogWidget::try_create().release_value_but_fixme_should_propagate_errors(); + dialog->set_main_widget(widget); auto icon_wrapper = widget->find_descendant_of_type_named("icon_wrapper"); if (icon) { diff --git a/Userland/Libraries/LibGUI/AboutDialog.gml b/Userland/Libraries/LibGUI/AboutDialog.gml index 6d13e37306..05417c7ab7 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.gml +++ b/Userland/Libraries/LibGUI/AboutDialog.gml @@ -1,4 +1,4 @@ -@GUI::Frame { +@GUI::AboutDialogWidget { fill_with_background_color: true layout: @GUI::VerticalBoxLayout { spacing: 0 diff --git a/Userland/Libraries/LibGUI/AboutDialogWidget.h b/Userland/Libraries/LibGUI/AboutDialogWidget.h new file mode 100644 index 0000000000..527a96681e --- /dev/null +++ b/Userland/Libraries/LibGUI/AboutDialogWidget.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024, Aarushi Chauhan . + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace GUI { + +class AboutDialogWidget : public GUI::Widget { + C_OBJECT_ABSTRACT(AboutDialogWidget) +public: + static ErrorOr> try_create(); + virtual ~AboutDialogWidget() override = default; + +private: + AboutDialogWidget() = default; +}; + +} diff --git a/Userland/Libraries/LibGUI/CMakeLists.txt b/Userland/Libraries/LibGUI/CMakeLists.txt index c1ed664f62..b10a2d7964 100644 --- a/Userland/Libraries/LibGUI/CMakeLists.txt +++ b/Userland/Libraries/LibGUI/CMakeLists.txt @@ -1,6 +1,6 @@ compile_gml(DynamicWidgetContainerControls.gml DynamicWidgetContainerControls.cpp) -stringify_gml(AboutDialog.gml AboutDialogGML.h about_dialog_gml) +compile_gml(AboutDialog.gml AboutDialogGML.cpp) stringify_gml(DatePickerDialog.gml DatePickerDialogGML.h date_picker_dialog_gml) stringify_gml(EmojiInputDialog.gml EmojiInputDialogGML.h emoji_input_dialog_gml) stringify_gml(FontPickerDialog.gml FontPickerDialogGML.h font_picker_dialog_gml) @@ -10,6 +10,7 @@ stringify_gml(PasswordInputDialog.gml PasswordInputDialogGML.h password_input_di set(SOURCES AboutDialog.cpp + AboutDialogGML.cpp AbstractButton.cpp AbstractScrollableWidget.cpp AbstractSlider.cpp @@ -146,7 +147,6 @@ set(GENERATED_SOURCES ../../Services/WindowServer/WindowManagerClientEndpoint.h ../../Services/WindowServer/WindowManagerServerEndpoint.h ../../Services/WindowServer/WindowServerEndpoint.h - AboutDialogGML.h DatePickerDialogGML.h EmojiInputDialogGML.h FilePickerDialogGML.h