1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

LibGfx+WindowServer: Add theme flag TitleButtonsIconOnly

With this flag set to true only the icon of the title button is painted.
This is useful for themes with a more non-serenity look such as
Coffee and Cupertino (that currently try to hide the button).
This commit is contained in:
MacDue 2022-04-23 15:23:22 +01:00 committed by Linus Groh
parent 5998e7f8a2
commit 9b30fe9864
5 changed files with 27 additions and 5 deletions

View file

@ -27,7 +27,9 @@ void Button::paint(Screen& screen, Gfx::Painter& painter)
auto palette = WindowManager::the().palette();
Gfx::PainterStateSaver saver(painter);
painter.translate(relative_rect().location());
Gfx::StylePainter::paint_button(painter, rect(), palette, Gfx::ButtonStyle::Normal, m_pressed, m_hovered);
if (m_style == Style::Normal)
Gfx::StylePainter::paint_button(painter, rect(), palette, Gfx::ButtonStyle::Normal, m_pressed, m_hovered);
if (m_icon) {
auto& bitmap = m_icon->bitmap(screen.scale_factor());