feat: add tray.getTitle() (#17385)

* feat: add tray.getTitle

* fix spec
This commit is contained in:
Shelley Vohr 2019-03-18 12:40:34 -07:00 committed by GitHub
parent 38d75010c7
commit 2fb9085e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 53 additions and 14 deletions

View file

@ -159,7 +159,17 @@ void Tray::SetToolTip(const std::string& tool_tip) {
}
void Tray::SetTitle(const std::string& title) {
#if defined(OS_MACOSX)
tray_icon_->SetTitle(title);
#endif
}
std::string Tray::GetTitle() {
#if defined(OS_MACOSX)
return tray_icon_->GetTitle();
#else
return "";
#endif
}
void Tray::SetHighlightMode(TrayIcon::HighlightMode mode) {
@ -227,6 +237,7 @@ void Tray::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setPressedImage", &Tray::SetPressedImage)
.SetMethod("setToolTip", &Tray::SetToolTip)
.SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("getTitle", &Tray::GetTitle)
.SetMethod("setHighlightMode", &Tray::SetHighlightMode)
.SetMethod("setIgnoreDoubleClickEvents",
&Tray::SetIgnoreDoubleClickEvents)

View file

@ -69,6 +69,7 @@ class Tray : public mate::TrackableObject<Tray>, public TrayIconObserver {
void SetPressedImage(v8::Isolate* isolate, mate::Handle<NativeImage> image);
void SetToolTip(const std::string& tool_tip);
void SetTitle(const std::string& title);
std::string GetTitle();
void SetHighlightMode(TrayIcon::HighlightMode mode);
void SetIgnoreDoubleClickEvents(bool ignore);
bool GetIgnoreDoubleClickEvents();