feat: add mouse-down & mouse-up to Tray (#21795)
This commit is contained in:
parent
5feafaceee
commit
5c6f9a6947
7 changed files with 54 additions and 0 deletions
|
@ -131,6 +131,10 @@
|
|||
}
|
||||
|
||||
- (void)mouseDown:(NSEvent*)event {
|
||||
trayIcon_->NotifyMouseDown(
|
||||
gfx::ScreenPointFromNSPoint([event locationInWindow]),
|
||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||
|
||||
// Pass click to superclass to show menu. Custom mouseUp handler won't be
|
||||
// invoked.
|
||||
if (menuController_) {
|
||||
|
@ -143,6 +147,10 @@
|
|||
- (void)mouseUp:(NSEvent*)event {
|
||||
[[statusItem_ button] highlight:NO];
|
||||
|
||||
trayIcon_->NotifyMouseUp(
|
||||
gfx::ScreenPointFromNSPoint([event locationInWindow]),
|
||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||
|
||||
// If we are ignoring double click events, we should ignore the `clickCount`
|
||||
// value and immediately emit a click event.
|
||||
BOOL shouldBeHandledAsASingleClick =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue