ClassicWindowTheme: Fix titlebar redraw issues

This fixes titlebar rects being overly large and leaving smeary
undrawn areas when using a theme with a titlebar height
different to 19px.
This commit is contained in:
Sarah 2020-08-10 08:45:40 +10:00 committed by Andreas Kling
parent 6613a4cb8c
commit 9714e61d62
Notes: sideshowbarker 2024-07-19 18:30:16 +09:00

View file

@ -109,7 +109,8 @@ IntRect ClassicWindowTheme::title_bar_rect(WindowType window_type, const IntRect
{ {
auto& title_font = Font::default_bold_font(); auto& title_font = Font::default_bold_font();
auto window_titlebar_height = palette.window_title_height(); auto window_titlebar_height = palette.window_title_height();
int total_vertical_padding = window_titlebar_height - title_font.glyph_height(); // FIXME: The top of the titlebar doesn't get redrawn properly if this padding is different
int total_vertical_padding = title_font.glyph_height() - 1;
if (window_type == WindowType::Notification) if (window_type == WindowType::Notification)
return { window_rect.width() + 3, total_vertical_padding / 2 - 1, window_titlebar_height, window_rect.height() }; return { window_rect.width() + 3, total_vertical_padding / 2 - 1, window_titlebar_height, window_rect.height() };