fix(electron): tray menu icon adapt to dark theme (#11288)

fix AF-2431
This commit is contained in:
pengx17
2025-03-31 07:23:01 +00:00
parent 94d5a42355
commit 8bea31698e
4 changed files with 8 additions and 7 deletions
@@ -64,6 +64,10 @@ function buildMenuConfig(config: TrayMenuConfig): MenuItemConstructorOptions[] {
}
if (nativeIcon) {
nativeIcon = nativeIcon.resize({ width: 20, height: 20 });
// string icon should be template image
if (typeof icon === 'string') {
nativeIcon.setTemplateImage(true);
}
}
const submenuConfig = submenu ? buildMenuConfig(submenu) : undefined;
menuConfig.push({