mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
Run: Use new GML compiler
This commit is contained in:
parent
05ea3d6be0
commit
6f554af9c5
4 changed files with 27 additions and 9 deletions
|
@ -4,15 +4,12 @@ serenity_component(
|
||||||
TARGETS Run
|
TARGETS Run
|
||||||
)
|
)
|
||||||
|
|
||||||
stringify_gml(Run.gml RunGML.h run_gml)
|
compile_gml(Run.gml RunGML.cpp)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
RunWindow.cpp
|
RunWindow.cpp
|
||||||
)
|
RunGML.cpp
|
||||||
|
|
||||||
set(GENERATED_SOURCES
|
|
||||||
RunGML.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_app(Run ICON app-run)
|
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
|
fill_with_background_color: true
|
||||||
layout: @GUI::VerticalBoxLayout {
|
layout: @GUI::VerticalBoxLayout {
|
||||||
margins: [4]
|
margins: [4]
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "RunWindow.h"
|
#include "RunWindow.h"
|
||||||
|
#include "MainWidget.h"
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
#include <AK/URL.h>
|
#include <AK/URL.h>
|
||||||
#include <Applications/Run/RunGML.h>
|
|
||||||
#include <LibCore/Process.h>
|
#include <LibCore/Process.h>
|
||||||
#include <LibCore/StandardPaths.h>
|
#include <LibCore/StandardPaths.h>
|
||||||
#include <LibDesktop/Launcher.h>
|
#include <LibDesktop/Launcher.h>
|
||||||
|
@ -41,8 +41,7 @@ RunWindow::RunWindow()
|
||||||
set_resizable(false);
|
set_resizable(false);
|
||||||
set_minimizable(false);
|
set_minimizable(false);
|
||||||
|
|
||||||
auto main_widget = set_main_widget<GUI::Widget>();
|
auto main_widget = set_main_widget<Run::MainWidget>();
|
||||||
main_widget->load_from_gml(run_gml).release_value_but_fixme_should_propagate_errors();
|
|
||||||
|
|
||||||
m_icon_image_widget = *main_widget->find_descendant_of_type_named<GUI::ImageWidget>("icon");
|
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));
|
m_icon_image_widget->set_bitmap(app_icon.bitmap_for_size(32));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue