WindowServer: Tweak the look of menus

Paint menus with a flatter outline instead of giving them the regular
window border.
This commit is contained in:
Andreas Kling 2021-03-25 21:10:49 +01:00
parent 91a68cb5d8
commit 05cc7d69ac
Notes: sideshowbarker 2024-07-18 21:05:43 +09:00
2 changed files with 5 additions and 6 deletions

View File

@ -100,7 +100,7 @@ static const int s_checked_bitmap_height = 9;
static const int s_submenu_arrow_bitmap_width = 9;
static const int s_submenu_arrow_bitmap_height = 9;
static const int s_item_icon_width = 16;
static const int s_stripe_width = 23;
static const int s_stripe_width = 24;
int Menu::content_width() const
{
@ -187,8 +187,8 @@ void Menu::draw()
Gfx::Painter painter(*menu_window()->backing_store());
Gfx::IntRect rect { {}, menu_window()->size() };
Gfx::StylePainter::paint_window_frame(painter, rect, palette);
painter.fill_rect(rect.shrunken(6, 6), palette.menu_base());
painter.draw_rect(rect, Color::Black);
painter.fill_rect(rect.shrunken(2, 2), palette.menu_base());
int width = this->content_width();
if (!s_checked_bitmap)
@ -203,7 +203,6 @@ void Menu::draw()
Gfx::IntRect stripe_rect { frame_thickness(), frame_thickness(), s_stripe_width, menu_window()->height() - frame_thickness() * 2 };
painter.fill_rect(stripe_rect, palette.menu_stripe());
painter.draw_line(stripe_rect.top_right(), stripe_rect.bottom_right(), palette.menu_stripe().darkened());
int visible_item_count = this->visible_item_count();

View File

@ -96,8 +96,8 @@ public:
int content_width() const;
int item_height() const { return 20; }
int frame_thickness() const { return 3; }
int item_height() const { return 22; }
int frame_thickness() const { return 2; }
int horizontal_padding() const { return left_padding() + right_padding(); }
int left_padding() const { return 14; }
int right_padding() const { return 14; }