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

WindowServer: Make automatic menu dismissal feel more "natural."

This commit is contained in:
Andreas Kling 2019-02-11 13:59:26 +01:00
parent 43d9994d93
commit 3c863e0ffa
4 changed files with 29 additions and 12 deletions

View file

@ -3,6 +3,7 @@
#include "WSWindow.h"
#include "WSMessage.h"
#include "WSMessageLoop.h"
#include "WSWindowManager.h"
#include <SharedGraphics/Painter.h>
#include <SharedGraphics/Font.h>
@ -131,6 +132,7 @@ void WSMenu::did_activate(WSMenuItem& item)
{
if (on_item_activation)
on_item_activation(item);
close();
}
WSMenuItem* WSMenu::item_at(const Point& position)
@ -142,3 +144,8 @@ WSMenuItem* WSMenu::item_at(const Point& position)
}
return nullptr;
}
void WSMenu::close()
{
WSWindowManager::the().close_menu(*this);
};