mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
SharedGraphics: Allow passing a Font to text drawing functions.
This way we don't have to juggle around with calls to Painter::set_font() which simplifies a bunch of places.
This commit is contained in:
parent
b8f999cbef
commit
ffe4522316
5 changed files with 63 additions and 29 deletions
|
@ -81,9 +81,7 @@ void WSWindowSwitcher::draw()
|
|||
rect_text_color = Color::DarkGray;
|
||||
}
|
||||
painter.blit(item_rect.location().translated(0, (item_rect.height() - window.icon().height()) / 2), window.icon(), window.icon().rect());
|
||||
painter.set_font(Font::default_bold_font());
|
||||
painter.draw_text(item_rect.translated(window.icon().width() + 4, 0), window.title(), TextAlignment::CenterLeft, text_color);
|
||||
painter.set_font(WSWindowManager::the().font());
|
||||
painter.draw_text(item_rect.translated(window.icon().width() + 4, 0), window.title(), WSWindowManager::the().window_title_font(), TextAlignment::CenterLeft, text_color);
|
||||
painter.draw_text(item_rect, window.rect().to_string(), TextAlignment::CenterRight, rect_text_color);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue