forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There isn't much layout right now, but it felt very wrong to not have the GML editor use GML. :^)
- Loading branch information
1 parent
0bc591a
commit d443a51
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
* Copyright (c) 2020-2021, Andreas Kling <[email protected]> | ||
* Copyright (c) 2021, Julius Heijmen <[email protected]> | ||
* Copyright (c) 2022, kleines Filmröllchen <[email protected]> | ||
* Copyright (c) 2022-2023, Sam Atkins <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
@@ -27,6 +28,7 @@ | |
#include <LibGUI/VimEditingEngine.h> | ||
#include <LibGUI/Window.h> | ||
#include <LibMain/Main.h> | ||
#include <Userland/DevTools/GMLPlayground/GMLPlaygroundWindowGML.h> | ||
|
||
namespace { | ||
|
||
|
@@ -84,9 +86,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | |
window->set_icon(app_icon.bitmap_for_size(16)); | ||
window->resize(800, 600); | ||
|
||
auto splitter = TRY(window->set_main_widget<GUI::HorizontalSplitter>()); | ||
auto editor = TRY(splitter->try_add<GUI::TextEditor>()); | ||
auto preview_frame_widget = TRY(splitter->try_add<GUI::Frame>()); | ||
auto main_widget = TRY(window->set_main_widget<GUI::Widget>()); | ||
TRY(main_widget->load_from_gml(gml_playground_window_gml)); | ||
|
||
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()); | ||
preview_window->set_title("Preview - GML Playground"); | ||
|