mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add tray.focus() (#19548)
This commit is contained in:
committed by
Shelley Vohr
parent
ed3b69ffb1
commit
03debb4ef9
@@ -221,6 +221,10 @@ void Tray::RemoveBalloon() {
|
||||
tray_icon_->RemoveBalloon();
|
||||
}
|
||||
|
||||
void Tray::Focus() {
|
||||
tray_icon_->Focus();
|
||||
}
|
||||
|
||||
void Tray::PopUpContextMenu(mate::Arguments* args) {
|
||||
mate::Handle<Menu> menu;
|
||||
args->GetNext(&menu);
|
||||
@@ -255,6 +259,7 @@ void Tray::BuildPrototype(v8::Isolate* isolate,
|
||||
&Tray::GetIgnoreDoubleClickEvents)
|
||||
.SetMethod("displayBalloon", &Tray::DisplayBalloon)
|
||||
.SetMethod("removeBalloon", &Tray::RemoveBalloon)
|
||||
.SetMethod("focus", &Tray::Focus)
|
||||
.SetMethod("popUpContextMenu", &Tray::PopUpContextMenu)
|
||||
.SetMethod("setContextMenu", &Tray::SetContextMenu)
|
||||
.SetMethod("getBounds", &Tray::GetBounds);
|
||||
|
||||
@@ -74,6 +74,7 @@ class Tray : public mate::TrackableObject<Tray>, public TrayIconObserver {
|
||||
bool GetIgnoreDoubleClickEvents();
|
||||
void DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
|
||||
void RemoveBalloon();
|
||||
void Focus();
|
||||
void PopUpContextMenu(mate::Arguments* args);
|
||||
void SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu);
|
||||
gfx::Rect GetBounds();
|
||||
|
||||
Reference in New Issue
Block a user