diff --git a/packages/tray_manager/lib/src/tray_manager.dart b/packages/tray_manager/lib/src/tray_manager.dart index d9d6a66..ed8b6e4 100644 --- a/packages/tray_manager/lib/src/tray_manager.dart +++ b/packages/tray_manager/lib/src/tray_manager.dart @@ -107,6 +107,7 @@ class TrayManager { String iconPath, { bool isTemplate = false, // macOS only TrayIconPositon iconPosition = TrayIconPositon.left, // macOS only + int iconSize = 18, // macOS only }) async { final Map arguments = { 'id': shortid.generate(), @@ -117,6 +118,7 @@ class TrayManager { ]), 'isTemplate': isTemplate, 'iconPosition': iconPosition.name, + 'iconSize': iconSize, }; switch (defaultTargetPlatform) { diff --git a/packages/tray_manager/macos/Classes/TrayManagerPlugin.swift b/packages/tray_manager/macos/Classes/TrayManagerPlugin.swift index 934d92e..731da79 100644 --- a/packages/tray_manager/macos/Classes/TrayManagerPlugin.swift +++ b/packages/tray_manager/macos/Classes/TrayManagerPlugin.swift @@ -135,10 +135,11 @@ public class TrayManagerPlugin: NSObject, FlutterPlugin, NSMenuDelegate { let base64Icon: String = args["base64Icon"] as! String; let isTemplate: Bool = args["isTemplate"] as! Bool; let iconPosition: String = args["iconPosition"] as! String; + let iconSize: Int = args["iconSize"] as! Int; let imageData = Data(base64Encoded: base64Icon, options: .ignoreUnknownCharacters) let image = NSImage(data: imageData!) - image!.size = NSSize(width: 18, height: 18) + image!.size = NSSize(width: iconSize, height: iconSize) image!.isTemplate = isTemplate if (trayIcon == nil) {