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

GTextEditor: Set the vertical scrollbar step size to the line height.

This makes us scroll one line at a time.
This commit is contained in:
Andreas Kling 2019-06-07 10:42:43 +02:00
parent 1d7b89cd1c
commit 0ece5fee14

View file

@ -22,6 +22,8 @@ GTextEditor::GTextEditor(Type type, GWidget* parent)
set_frame_thickness(2); set_frame_thickness(2);
set_scrollbars_enabled(is_multi_line()); set_scrollbars_enabled(is_multi_line());
set_font(GFontDatabase::the().get_by_name("Csilla Thin")); set_font(GFontDatabase::the().get_by_name("Csilla Thin"));
// FIXME: Recompute vertical scrollbar step size on font change.
vertical_scrollbar().set_step(line_height());
m_lines.append(make<Line>()); m_lines.append(make<Line>());
m_cursor = { 0, 0 }; m_cursor = { 0, 0 };
create_actions(); create_actions();