5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 23:59:52 +08:00
wails/v3/pkg/application/systemtray_darwin.h
Thomas Sénéchal 44bbce125b
[V3/macos] Fix systray click handling when no attached window (#3207)
* Fix systray click handling

* Open Menu if no window is attached in defaultClickHandler()

* Remove systemTraySetMenu function

* Fix a crash in hide-window example

* Update changelog
2024-01-17 22:36:22 +11:00

18 lines
758 B
Objective-C

//go:build darwin
@interface StatusItemController : NSObject
@property long id;
- (void)statusItemClicked:(id)sender;
@end
void* systemTrayNew(long id);
void systemTraySetLabel(void* nsStatusItem, char *label);
void systemTraySetANSILabel(void* nsStatusItem, void* attributedString);
void* createAttributedString(char *title, char *FG, char *BG);
void* appendAttributedString(void* original, char* label, char* fg, char* bg);
NSImage* imageFromBytes(const unsigned char *bytes, int length);
void systemTraySetIcon(void* nsStatusItem, void* nsImage, int position, bool isTemplate);
void systemTrayDestroy(void* nsStatusItem);
void showMenu(void* nsStatusItem, void *nsMenu);
void systemTrayGetBounds(void* nsStatusItem, NSRect *rect);
int statusBarHeight();