1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:05:07 +00:00

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

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