mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
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! :^)
This commit is contained in:
parent
999e3f87a9
commit
dc55fbeb79
Notes:
sideshowbarker
2024-07-19 00:33:36 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/dc55fbeb791 Pull-request: https://github.com/SerenityOS/serenity/pull/4573
1 changed files with 8 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue