Support updating tray labels in an efficient manner

This commit is contained in:
Lea Anthony
2021-01-16 11:35:49 +11:00
parent 7ac8cc6b8b
commit 47bca0be88
17 changed files with 155 additions and 38 deletions

View File

@@ -913,7 +913,8 @@ void SetDebug(void *applicationPointer, int flag) {
}
// SetContextMenus sets the context menu map for this application
// AddContextMenu sets the context menu map for this application
void AddContextMenu(struct Application *app, const char *contextMenuJSON) {
AddContextMenuToStore(app->contextMenuStore, contextMenuJSON);
}
@@ -932,6 +933,13 @@ void SetTrayMenu(struct Application *app, const char* trayMenuJSON) {
);
}
void UpdateTrayMenuLabel(struct Application* app, const char* JSON) {
ON_MAIN_THREAD(
UpdateTrayMenuLabelInStore(app->trayMenuStore, JSON);
);
}
void SetBindings(struct Application *app, const char *bindings) {
const char* temp = concat("window.wailsbindings = \"", bindings);
const char* jscall = concat(temp, "\";");