1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:17:36 +00:00

WindowServer: Fix menu over-drawing

We only need to re-draw the item being selected and the item being
deselected. We also don't care anymore if applets were added or
removed as we no longer have a global menu bar.
This commit is contained in:
Tom 2021-07-18 14:38:34 -06:00 committed by Andreas Kling
parent 8a4971f908
commit 7ae46ae218
6 changed files with 114 additions and 83 deletions

View file

@ -93,10 +93,12 @@ public:
static constexpr int right_padding() { return 14; }
void draw();
void draw(MenuItem const&, bool = false);
const Gfx::Font& font() const;
MenuItem* item_with_identifier(unsigned);
void redraw();
void redraw(MenuItem const&);
MenuItem* hovered_item() const;
@ -130,6 +132,7 @@ private:
void handle_mouse_move_event(const MouseEvent&);
size_t visible_item_count() const;
Gfx::IntRect stripe_rect();
int item_index_at(const Gfx::IntPoint&);
static constexpr int padding_between_text_and_shortcut() { return 50; }