1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibGUI: Use enum for TextEditor modes & add new DisplayOnly mode

Adds a new, more restrictive read-only state to TextEditor which
forbids copying, selecting, editor cursors, and context menus.
Provides a unique appearance on focus which accomodates ComboBox
widgets. All TextEditor modes are now accessed by enum and
set_mode() which sets the editor to Editable, ReadOnly or
DisplayOnly. Updates applications still using set_readonly().
This commit is contained in:
thankyouverycool 2020-07-14 17:02:46 -04:00 committed by Andreas Kling
parent dc716194c8
commit b2783a234a
6 changed files with 92 additions and 18 deletions

View file

@ -177,7 +177,7 @@ void ComboBox::set_only_allow_values_from_model(bool b)
if (m_only_allow_values_from_model == b)
return;
m_only_allow_values_from_model = b;
m_editor->set_readonly(m_only_allow_values_from_model);
m_editor->set_mode(m_only_allow_values_from_model ? TextEditor::DisplayOnly : TextEditor::Editable);
}
Model* ComboBox::model()