From 750a6084413384873e85a3bd34a21d9fddce6361 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 28 Dec 2020 13:01:41 +0100 Subject: [PATCH] LibGUI: Register TextEditor "mode" property This makes it possible to construct a read-only (or display-only) TextEditor in GML: @GUI::TextEditor { mode: "ReadOnly" text: "Well hello friends! :^)" } --- Libraries/LibGUI/TextEditor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index ad5fd82ea23..133db5c567c 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -55,6 +55,10 @@ TextEditor::TextEditor(Type type) : m_type(type) { REGISTER_STRING_PROPERTY("text", text, set_text); + REGISTER_ENUM_PROPERTY("mode", mode, set_mode, Mode, + { Editable, "Editable" }, + { ReadOnly, "ReadOnly" }, + { DisplayOnly, "DisplayOnly" }); set_focus_policy(GUI::FocusPolicy::StrongFocus); set_accepts_emoji_input(true);