File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ Tray::Tray(int id,
51
51
52
52
std::string tooltip;
53
53
if (option.GetString (" tooltip" , &tooltip))
54
- SetTitle (tooltip);
54
+ SetTooltip (tooltip);
55
55
56
56
int menu_id;
57
57
if (option.GetInteger (" menu" , &menu_id))
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class Tray : public Base {
64
64
void Destroy ();
65
65
void SetTitle (const std::string& title);
66
66
void SetIcon (const std::string& icon_path);
67
- void SetTooltip (const std::string& title );
67
+ void SetTooltip (const std::string& tooltip );
68
68
void SetMenu (Menu* menu);
69
69
void Remove ();
70
70
// Alternate icons only work with Macs
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ - (void)onClick:(id)sender {
75
75
}
76
76
77
77
void Tray::SetTitle (const std::string& title) {
78
+ // note: this is kind of mad but the first time we set the title property
79
+ // we have to call setTitle twice or it won't get the right dimensions
80
+ if ([status_item_ title ] != nil ) {
81
+ [status_item_ setTitle: [NSString stringWithUTF8String: title.c_str ()]];
82
+ }
78
83
[status_item_ setTitle: [NSString stringWithUTF8String: title.c_str ()]];
79
84
}
80
85
You can’t perform that action at this time.
0 commit comments