mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
AboutDialog: Port to GML Complier
This commit is contained in:
parent
ea59bfaae7
commit
564e619f57
Notes:
sideshowbarker
2024-07-19 16:49:45 +09:00
Author: https://github.com/Hiraeth19 🔰 Commit: https://github.com/SerenityOS/serenity/commit/564e619f57a Pull-request: https://github.com/SerenityOS/serenity/pull/23029 Reviewed-by: https://github.com/timschumi
4 changed files with 29 additions and 6 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibGUI/AboutDialog.h>
|
||||
#include <LibGUI/AboutDialogGML.h>
|
||||
#include <LibGUI/AboutDialogWidget.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/ImageWidget.h>
|
||||
|
@ -24,8 +24,8 @@ NonnullRefPtr<AboutDialog> 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<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<Widget>("icon_wrapper");
|
||||
if (icon) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@GUI::Frame {
|
||||
@GUI::AboutDialogWidget {
|
||||
fill_with_background_color: true
|
||||
layout: @GUI::VerticalBoxLayout {
|
||||
spacing: 0
|
||||
|
|
23
Userland/Libraries/LibGUI/AboutDialogWidget.h
Normal file
23
Userland/Libraries/LibGUI/AboutDialogWidget.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aarushi Chauhan <aarushi595.chauhan@gmail.com>.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Frame.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class AboutDialogWidget : public GUI::Widget {
|
||||
C_OBJECT_ABSTRACT(AboutDialogWidget)
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<AboutDialogWidget>> try_create();
|
||||
virtual ~AboutDialogWidget() override = default;
|
||||
|
||||
private:
|
||||
AboutDialogWidget() = default;
|
||||
};
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue