mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:27:34 +00:00
Welcome: Port to GML Compiler
This commit is contained in:
parent
0a4ef6f3b7
commit
69ffdd5738
5 changed files with 15 additions and 16 deletions
|
@ -7,7 +7,6 @@
|
|||
#include "WelcomeWidget.h"
|
||||
#include <AK/Random.h>
|
||||
#include <AK/String.h>
|
||||
#include <Applications/Welcome/WelcomeWindowGML.h>
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibGUI/Application.h>
|
||||
|
@ -19,9 +18,10 @@
|
|||
#include <LibGUI/Process.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
ErrorOr<NonnullRefPtr<WelcomeWidget>> WelcomeWidget::try_create()
|
||||
namespace Welcome {
|
||||
ErrorOr<NonnullRefPtr<WelcomeWidget>> WelcomeWidget::create()
|
||||
{
|
||||
auto welcome_widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) WelcomeWidget()));
|
||||
auto welcome_widget = TRY(WelcomeWidget::try_create());
|
||||
TRY(welcome_widget->create_widgets());
|
||||
|
||||
return welcome_widget;
|
||||
|
@ -29,8 +29,6 @@ ErrorOr<NonnullRefPtr<WelcomeWidget>> WelcomeWidget::try_create()
|
|||
|
||||
ErrorOr<void> WelcomeWidget::create_widgets()
|
||||
{
|
||||
TRY(load_from_gml(welcome_window_gml));
|
||||
|
||||
m_banner_widget = find_descendant_of_type_named<GUI::Widget>("welcome_banner");
|
||||
m_banner_font = TRY(Gfx::BitmapFont::try_load_from_uri("resource://fonts/MarietaRegular24.font"sv));
|
||||
|
||||
|
@ -130,3 +128,4 @@ void WelcomeWidget::paint_event(GUI::PaintEvent& event)
|
|||
rect.set_x(rect.x() + static_cast<int>(ceilf(m_banner_font->bold_variant().width("Serenity"sv))));
|
||||
painter.draw_text(rect, "OS"sv, m_banner_font->bold_variant(), Gfx::TextAlignment::CenterLeft, palette().tray_text());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue