summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GTextEditor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-01 12:26:35 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-01 12:26:35 +0200
commit3e2e0860113791cc1f0ce05f0fe013b41a4d5c96 (patch)
tree5b7b799db33ea67ee248e60fcd9ffb879e3b98d0 /Libraries/LibGUI/GTextEditor.cpp
parente7d15ccca4a010c19374a3bfe895283df246b293 (diff)
downloadserenity-3e2e0860113791cc1f0ce05f0fe013b41a4d5c96.zip
LibGUI: Add a way for GWidget subclasses to learn that the font changed
Use this in GTextEditor to update the vertical scrolling step size so we always scroll one-line-at-a-time.
Diffstat (limited to 'Libraries/LibGUI/GTextEditor.cpp')
-rw-r--r--Libraries/LibGUI/GTextEditor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GTextEditor.cpp b/Libraries/LibGUI/GTextEditor.cpp
index caef69ac4d..6fb7aa7219 100644
--- a/Libraries/LibGUI/GTextEditor.cpp
+++ b/Libraries/LibGUI/GTextEditor.cpp
@@ -1448,3 +1448,9 @@ void GTextEditor::add_custom_context_menu_action(GAction& action)
{
m_custom_context_menu_actions.append(action);
}
+
+void GTextEditor::did_change_font()
+{
+ vertical_scrollbar().set_step(line_height());
+ GWidget::did_change_font();
+}