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! :^)"
    }
This commit is contained in:
Linus Groh 2020-12-28 13:01:41 +01:00 committed by Andreas Kling
parent 1e70986d19
commit 750a608441
Notes: sideshowbarker 2024-07-19 00:26:58 +09:00

View File

@ -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);