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

GTextEditor: Add GTextEditor::on_change callback for when content changes.

This commit is contained in:
Andreas Kling 2019-04-09 16:20:36 +02:00
parent 60a819c14a
commit 151b7149e6
2 changed files with 24 additions and 6 deletions

View file

@ -96,6 +96,7 @@ public:
void do_delete();
void delete_current_line();
Function<void()> on_change;
Function<void(GTextEditor&)> on_return_pressed;
Function<void(GTextEditor&)> on_escape_pressed;
@ -116,6 +117,7 @@ private:
void paint_ruler(Painter&);
void update_content_size();
void did_change();
class Line {
friend class GTextEditor;
@ -163,6 +165,7 @@ private:
bool m_cursor_state { true };
bool m_in_drag_select { false };
bool m_ruler_visible { true };
bool m_have_pending_change_notification { false };
int m_line_spacing { 4 };
int m_soft_tab_width { 4 };
int m_horizontal_content_padding { 2 };