Merge pull request #12496 from mikeykhalil/8952-ignore-tray-double-click-events

8952 option to ignore tray double click events
This commit is contained in:
John Kleinschmidt 2018-05-16 10:17:36 -04:00 committed by GitHub
commit 9488ef4867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 3 deletions

View file

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

View file

@ -70,6 +70,8 @@ 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);
bool GetIgnoreDoubleClickEvents();
void DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
void PopUpContextMenu(mate::Arguments* args);
void SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu);