mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
GMLPlayground: Move layout to GML
There isn't much layout right now, but it felt very wrong to not have the GML editor use GML. :^)
This commit is contained in:
parent
0bc591a69b
commit
d443a51b50
3 changed files with 31 additions and 3 deletions
|
@ -4,9 +4,15 @@ serenity_component(
|
||||||
TARGETS GMLPlayground
|
TARGETS GMLPlayground
|
||||||
)
|
)
|
||||||
|
|
||||||
|
compile_gml(GMLPlaygroundWindow.gml GMLPlaygroundWindowGML.h gml_playground_window_gml)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(GENERATED_SOURCES
|
||||||
|
GMLPlaygroundWindowGML.h
|
||||||
|
)
|
||||||
|
|
||||||
serenity_app(GMLPlayground ICON app-gml-playground)
|
serenity_app(GMLPlayground ICON app-gml-playground)
|
||||||
target_link_libraries(GMLPlayground PRIVATE LibCore LibDesktop LibFileSystemAccessClient LibGfx LibGUI LibMain LibSyntax)
|
target_link_libraries(GMLPlayground PRIVATE LibCore LibDesktop LibFileSystemAccessClient LibGfx LibGUI LibMain LibSyntax)
|
||||||
|
|
17
Userland/DevTools/GMLPlayground/GMLPlaygroundWindow.gml
Normal file
17
Userland/DevTools/GMLPlayground/GMLPlaygroundWindow.gml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@GUI::Widget {
|
||||||
|
layout: @GUI::VerticalBoxLayout {}
|
||||||
|
fill_with_background_color: true
|
||||||
|
|
||||||
|
@GUI::HorizontalSplitter {
|
||||||
|
layout: @GUI::HorizontalBoxLayout {}
|
||||||
|
name: "splitter"
|
||||||
|
|
||||||
|
@GUI::TextEditor {
|
||||||
|
name: "text_editor"
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::Frame {
|
||||||
|
name: "preview_frame"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2021, Julius Heijmen <julius.heijmen@gmail.com>
|
* Copyright (c) 2021, Julius Heijmen <julius.heijmen@gmail.com>
|
||||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||||
|
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -27,6 +28,7 @@
|
||||||
#include <LibGUI/VimEditingEngine.h>
|
#include <LibGUI/VimEditingEngine.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibMain/Main.h>
|
#include <LibMain/Main.h>
|
||||||
|
#include <Userland/DevTools/GMLPlayground/GMLPlaygroundWindowGML.h>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -84,9 +86,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
window->set_icon(app_icon.bitmap_for_size(16));
|
window->set_icon(app_icon.bitmap_for_size(16));
|
||||||
window->resize(800, 600);
|
window->resize(800, 600);
|
||||||
|
|
||||||
auto splitter = TRY(window->set_main_widget<GUI::HorizontalSplitter>());
|
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
||||||
auto editor = TRY(splitter->try_add<GUI::TextEditor>());
|
TRY(main_widget->load_from_gml(gml_playground_window_gml));
|
||||||
auto preview_frame_widget = TRY(splitter->try_add<GUI::Frame>());
|
|
||||||
|
auto splitter = main_widget->find_descendant_of_type_named<GUI::HorizontalSplitter>("splitter");
|
||||||
|
auto editor = main_widget->find_descendant_of_type_named<GUI::TextEditor>("text_editor");
|
||||||
|
auto preview_frame_widget = main_widget->find_descendant_of_type_named<GUI::Frame>("preview_frame");
|
||||||
|
|
||||||
auto preview_window = TRY(GUI::Window::try_create());
|
auto preview_window = TRY(GUI::Window::try_create());
|
||||||
preview_window->set_title("Preview - GML Playground");
|
preview_window->set_title("Preview - GML Playground");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue