mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibGUI: Paint GUI::TextEditor's optional icon before applying text clip
We were chopping the top row of pixels off of the website favicons in Browser's location editor. :^)
This commit is contained in:
parent
24fd8fb16f
commit
1b9e98a17d
Notes:
sideshowbarker
2024-07-17 19:40:40 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1b9e98a17d4
@ -430,6 +430,11 @@ void TextEditor::paint_event(PaintEvent& event)
|
||||
|
||||
painter.translate(frame_thickness(), frame_thickness());
|
||||
|
||||
if (!is_multi_line() && m_icon) {
|
||||
Gfx::IntRect icon_rect { icon_padding(), 1, icon_size(), icon_size() };
|
||||
painter.draw_scaled_bitmap(icon_rect, *m_icon, m_icon->rect());
|
||||
}
|
||||
|
||||
if (m_gutter_visible) {
|
||||
auto gutter_rect = gutter_rect_in_inner_coordinates();
|
||||
painter.fill_rect(gutter_rect, palette().gutter());
|
||||
@ -717,11 +722,6 @@ void TextEditor::paint_event(PaintEvent& event)
|
||||
});
|
||||
}
|
||||
|
||||
if (!is_multi_line() && m_icon) {
|
||||
Gfx::IntRect icon_rect { icon_padding(), 1, icon_size(), icon_size() };
|
||||
painter.draw_scaled_bitmap(icon_rect, *m_icon, m_icon->rect());
|
||||
}
|
||||
|
||||
if (is_enabled() && is_focused() && m_cursor_state && !is_displayonly())
|
||||
painter.fill_rect(cursor_content_rect(), palette().text_cursor());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user