updated Tray API to ignore double click events on macOS (#8952)

This commit is contained in:
mikeykhalil 2018-04-01 18:07:26 -07:00
parent a08b4f780c
commit 1f29124d11
6 changed files with 36 additions and 0 deletions

View file

@ -176,6 +176,10 @@ void Tray::SetHighlightMode(TrayIcon::HighlightMode mode) {
tray_icon_->SetHighlightMode(mode);
}
void Tray::SetIgnoreDoubleClickEvents(bool ignore) {
tray_icon_->SetIgnoreDoubleClickEvents(ignore);
}
void Tray::DisplayBalloon(mate::Arguments* args,
const mate::Dictionary& options) {
mate::Handle<NativeImage> icon;
@ -224,6 +228,8 @@ void Tray::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setToolTip", &Tray::SetToolTip)
.SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("setHighlightMode", &Tray::SetHighlightMode)
.SetMethod("setIgnoreDoubleClickEvents",
&Tray::SetIgnoreDoubleClickEvents)
.SetMethod("displayBalloon", &Tray::DisplayBalloon)
.SetMethod("popUpContextMenu", &Tray::PopUpContextMenu)
.SetMethod("setContextMenu", &Tray::SetContextMenu)

View file

@ -70,6 +70,7 @@ class Tray : public mate::TrackableObject<Tray>, public TrayIconObserver {
void SetToolTip(const std::string& tool_tip);
void SetTitle(const std::string& title);
void SetHighlightMode(TrayIcon::HighlightMode mode);
void SetIgnoreDoubleClickEvents(bool ignore);
void DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
void PopUpContextMenu(mate::Arguments* args);
void SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu);