mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Run: Use new GML compiler
This commit is contained in:
parent
05ea3d6be0
commit
6f554af9c5
Notes:
sideshowbarker
2024-07-17 03:10:07 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/6f554af9c5 Pull-request: https://github.com/SerenityOS/serenity/pull/20524 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/timschumi ✅
4 changed files with 27 additions and 9 deletions
|
@ -4,15 +4,12 @@ serenity_component(
|
|||
TARGETS Run
|
||||
)
|
||||
|
||||
stringify_gml(Run.gml RunGML.h run_gml)
|
||||
compile_gml(Run.gml RunGML.cpp)
|
||||
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
RunWindow.cpp
|
||||
)
|
||||
|
||||
set(GENERATED_SOURCES
|
||||
RunGML.h
|
||||
RunGML.cpp
|
||||
)
|
||||
|
||||
serenity_app(Run ICON app-run)
|
||||
|
|
22
Userland/Applications/Run/MainWidget.h
Normal file
22
Userland/Applications/Run/MainWidget.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Widget.h>
|
||||
|
||||
namespace Run {
|
||||
|
||||
class MainWidget : public GUI::Widget {
|
||||
C_OBJECT(MainWidget)
|
||||
public:
|
||||
MainWidget() = default;
|
||||
static ErrorOr<NonnullRefPtr<MainWidget>> try_create();
|
||||
|
||||
virtual ~MainWidget() override = default;
|
||||
};
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
@GUI::Widget {
|
||||
@Run::MainWidget {
|
||||
fill_with_background_color: true
|
||||
layout: @GUI::VerticalBoxLayout {
|
||||
margins: [4]
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
*/
|
||||
|
||||
#include "RunWindow.h"
|
||||
#include "MainWidget.h"
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/URL.h>
|
||||
#include <Applications/Run/RunGML.h>
|
||||
#include <LibCore/Process.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
|
@ -41,8 +41,7 @@ RunWindow::RunWindow()
|
|||
set_resizable(false);
|
||||
set_minimizable(false);
|
||||
|
||||
auto main_widget = set_main_widget<GUI::Widget>();
|
||||
main_widget->load_from_gml(run_gml).release_value_but_fixme_should_propagate_errors();
|
||||
auto main_widget = set_main_widget<Run::MainWidget>();
|
||||
|
||||
m_icon_image_widget = *main_widget->find_descendant_of_type_named<GUI::ImageWidget>("icon");
|
||||
m_icon_image_widget->set_bitmap(app_icon.bitmap_for_size(32));
|
||||
|
|
Loading…
Reference in a new issue