1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:58:11 +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

@ -261,7 +261,7 @@ Tab::Tab(Type type)
auto window = GUI::Window::construct();
auto& editor = window->set_main_widget<GUI::TextEditor>();
editor.set_text(source);
editor.set_readonly(true);
editor.set_mode(GUI::TextEditor::ReadOnly);
editor.set_ruler_visible(true);
window->set_rect(150, 150, 640, 480);
window->set_title(url);