1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

WindowServer: Improve the look of menus.

This patch makes menus stand out a bit more from their background by using
the same kind of shading that Windows 2000 had.
This commit is contained in:
Andreas Kling 2019-04-16 17:02:26 +02:00
parent 311019d8ee
commit 86361d3d45
6 changed files with 32 additions and 18 deletions

View file

@ -166,3 +166,22 @@ void StylePainter::paint_frame(Painter& painter, const Rect& rect, FrameShape sh
painter.draw_line(inner_rect.top_right(), inner_rect.bottom_right().translated(0, -1), bottom_right_color);
}
}
void StylePainter::paint_menu_frame(Painter& painter, const Rect& rect)
{
Color top_left_color;
Color bottom_right_color;
Color base_color = Color::from_rgb(0xc0c0c0);
Color dark_shade = Color::from_rgb(0x404040);
Color mid_shade = Color::from_rgb(0x808080);
Color light_shade = Color::from_rgb(0xffffff);
painter.draw_line(rect.top_left(), rect.top_right(), base_color);
painter.draw_line(rect.top_left().translated(0, 1), rect.bottom_left(), base_color);
painter.draw_line(rect.top_left().translated(1, 1), rect.top_right().translated(-1, 1), light_shade);
painter.draw_line(rect.top_left().translated(1, 1), rect.bottom_left().translated(1, -1), light_shade);
painter.draw_line(rect.top_right(), rect.bottom_right(), dark_shade);
painter.draw_line(rect.bottom_left(), rect.bottom_right(), dark_shade);
painter.draw_line(rect.top_right().translated(-1, 1), rect.bottom_right().translated(-1, -1), mid_shade);
painter.draw_line(rect.bottom_left().translated(1, -1), rect.bottom_right().translated(-1, -1), mid_shade);
}