feat: add tray.getTitle() (#17385)
* feat: add tray.getTitle * fix spec
This commit is contained in:
parent
38d75010c7
commit
2fb9085e5b
8 changed files with 53 additions and 14 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue