mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibGUI: Simplify DisplayOnly painting for TextEditor
This commit is contained in:
parent
2c1a417513
commit
6f37351142
Notes:
sideshowbarker
2024-07-17 19:39:35 +09:00
Author: https://github.com/thankyouverycool
Commit: 6f37351142
Pull-request: https://github.com/SerenityOS/serenity/pull/12264
Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 4 deletions
|
@ -418,16 +418,13 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
};
|
||||
|
||||
if (is_displayonly() && is_focused()) {
|
||||
widget_background_color = palette().selection();
|
||||
Gfx::IntRect display_rect {
|
||||
widget_inner_rect().x() + 1,
|
||||
widget_inner_rect().y() + 1,
|
||||
widget_inner_rect().width() - 2,
|
||||
widget_inner_rect().height() - 2
|
||||
};
|
||||
painter.add_clip_rect(display_rect);
|
||||
painter.add_clip_rect(event.rect());
|
||||
painter.fill_rect(event.rect(), widget_background_color);
|
||||
painter.fill_rect(display_rect, palette().selection());
|
||||
}
|
||||
|
||||
painter.translate(frame_thickness(), frame_thickness());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue