mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
AboutDialog: Port to GML Complier
This commit is contained in:
parent
ea59bfaae7
commit
564e619f57
4 changed files with 29 additions and 6 deletions
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibGUI/AboutDialog.h>
|
#include <LibGUI/AboutDialog.h>
|
||||||
#include <LibGUI/AboutDialogGML.h>
|
#include <LibGUI/AboutDialogWidget.h>
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
#include <LibGUI/Button.h>
|
#include <LibGUI/Button.h>
|
||||||
#include <LibGUI/ImageWidget.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));
|
auto dialog = adopt_ref(*new AboutDialog(name, version, icon, parent_window));
|
||||||
dialog->set_title(ByteString::formatted("About {}", name));
|
dialog->set_title(ByteString::formatted("About {}", name));
|
||||||
|
|
||||||
auto widget = dialog->set_main_widget<Widget>();
|
auto widget = AboutDialogWidget::try_create().release_value_but_fixme_should_propagate_errors();
|
||||||
MUST(widget->load_from_gml(about_dialog_gml));
|
dialog->set_main_widget(widget);
|
||||||
|
|
||||||
auto icon_wrapper = widget->find_descendant_of_type_named<Widget>("icon_wrapper");
|
auto icon_wrapper = widget->find_descendant_of_type_named<Widget>("icon_wrapper");
|
||||||
if (icon) {
|
if (icon) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@GUI::Frame {
|
@GUI::AboutDialogWidget {
|
||||||
fill_with_background_color: true
|
fill_with_background_color: true
|
||||||
layout: @GUI::VerticalBoxLayout {
|
layout: @GUI::VerticalBoxLayout {
|
||||||
spacing: 0
|
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)
|
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(DatePickerDialog.gml DatePickerDialogGML.h date_picker_dialog_gml)
|
||||||
stringify_gml(EmojiInputDialog.gml EmojiInputDialogGML.h emoji_input_dialog_gml)
|
stringify_gml(EmojiInputDialog.gml EmojiInputDialogGML.h emoji_input_dialog_gml)
|
||||||
stringify_gml(FontPickerDialog.gml FontPickerDialogGML.h font_picker_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
|
set(SOURCES
|
||||||
AboutDialog.cpp
|
AboutDialog.cpp
|
||||||
|
AboutDialogGML.cpp
|
||||||
AbstractButton.cpp
|
AbstractButton.cpp
|
||||||
AbstractScrollableWidget.cpp
|
AbstractScrollableWidget.cpp
|
||||||
AbstractSlider.cpp
|
AbstractSlider.cpp
|
||||||
|
@ -146,7 +147,6 @@ set(GENERATED_SOURCES
|
||||||
../../Services/WindowServer/WindowManagerClientEndpoint.h
|
../../Services/WindowServer/WindowManagerClientEndpoint.h
|
||||||
../../Services/WindowServer/WindowManagerServerEndpoint.h
|
../../Services/WindowServer/WindowManagerServerEndpoint.h
|
||||||
../../Services/WindowServer/WindowServerEndpoint.h
|
../../Services/WindowServer/WindowServerEndpoint.h
|
||||||
AboutDialogGML.h
|
|
||||||
DatePickerDialogGML.h
|
DatePickerDialogGML.h
|
||||||
EmojiInputDialogGML.h
|
EmojiInputDialogGML.h
|
||||||
FilePickerDialogGML.h
|
FilePickerDialogGML.h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue