summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-12-27 17:21:31 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-27 18:36:43 +0100
commitdc55fbeb791aef5bc5c4793a029390939da0b07a (patch)
tree31f192a008c6b601501120ec4cbf985c251d2a58 /DevTools
parent999e3f87a96cd2d11d3777dab002678802588d01 (diff)
downloadserenity-dc55fbeb791aef5bc5c4793a029390939da0b07a.zip
Playground: Pre-populate the text editor with some GML
The text editor is now populated with some very basic GML after startup: @GUI::Widget { layout: @GUI::VerticalBoxLayout { } // Now add some widgets! } Less typing, less intimidating! :^)
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/Playground/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/DevTools/Playground/main.cpp b/DevTools/Playground/main.cpp
index cb40a80909..f24780e826 100644
--- a/DevTools/Playground/main.cpp
+++ b/DevTools/Playground/main.cpp
@@ -44,6 +44,14 @@ int main(int argc, char** argv)
editor.set_syntax_highlighter(make<GUI::GMLSyntaxHighlighter>());
editor.set_automatic_indentation_enabled(true);
+ editor.set_text(R"~~~(@GUI::Widget {
+ layout: @GUI::VerticalBoxLayout {
+ }
+
+ // Now add some widgets!
+}
+)~~~");
+ editor.set_cursor(4, 28); // after "...widgets!"
editor.on_change = [&] {
preview.remove_all_children();