mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGUI: Consider TextEditor icon size when scrolling text horizontally
If an icon exists and the horizontal scroll value is larger than 0, translate the TextEditor painter by the icon size and padding. The text would scroll over the icon when the text was long enough to trigger a horizontal scroll. Fixes #13669.
This commit is contained in:
parent
a20bf80b05
commit
62d41d58d6
Notes:
sideshowbarker
2024-07-17 11:06:08 +09:00
Author: https://github.com/OFFTKP Commit: https://github.com/SerenityOS/serenity/commit/62d41d58d6 Pull-request: https://github.com/SerenityOS/serenity/pull/13972 Issue: https://github.com/SerenityOS/serenity/issues/13669 Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 1 deletions
|
@ -452,7 +452,10 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
painter.draw_line(ruler_rect.top_right(), ruler_rect.bottom_right(), palette().ruler_border());
|
||||
}
|
||||
|
||||
painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
|
||||
auto horizontal_scrollbar_value = horizontal_scrollbar().value();
|
||||
painter.translate(-horizontal_scrollbar_value, -vertical_scrollbar().value());
|
||||
if (m_icon && horizontal_scrollbar_value > 0)
|
||||
painter.translate(min(icon_size() + icon_padding(), horizontal_scrollbar_value), 0);
|
||||
painter.translate(gutter_width(), 0);
|
||||
painter.translate(ruler_width(), 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue