diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-07 12:25:25 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-07 12:25:25 +0100 |
commit | 1b9e98a17d48a69c1d5c4c1184cba9588ccb509b (patch) | |
tree | 70da73ed9e6475e33fee75ca47c3c8ba76cd8c99 /Userland/Libraries/LibGUI | |
parent | 24fd8fb16f0779d2bfd172192b0d24c25444fad4 (diff) | |
download | serenity-1b9e98a17d48a69c1d5c4c1184cba9588ccb509b.zip |
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. :^)
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/TextEditor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 29b16be858..82893312b4 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -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()); } |