mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibGUI: Use PainterStateSaver in GStyle::paint_button().
This commit is contained in:
parent
88f6ce152f
commit
e009be5973
1 changed files with 1 additions and 2 deletions
|
@ -23,6 +23,7 @@ void GStyle::paint_button(Painter& painter, const Rect& rect, GButtonStyle butto
|
||||||
if (button_style == GButtonStyle::Normal)
|
if (button_style == GButtonStyle::Normal)
|
||||||
painter.draw_rect(rect, Color::Black, true);
|
painter.draw_rect(rect, Color::Black, true);
|
||||||
|
|
||||||
|
PainterStateSaver saver(painter);
|
||||||
painter.translate(rect.location());
|
painter.translate(rect.location());
|
||||||
|
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
|
@ -48,8 +49,6 @@ void GStyle::paint_button(Painter& painter, const Rect& rect, GButtonStyle butto
|
||||||
painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, shadow_color);
|
painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, shadow_color);
|
||||||
painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, shadow_color);
|
painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, shadow_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
painter.translate(-rect.location().x(), -rect.location().y());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GStyle::paint_surface(Painter& painter, const Rect& rect)
|
void GStyle::paint_surface(Painter& painter, const Rect& rect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue