diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b1f417c66..03d913c91 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -145,6 +145,7 @@ jobs:
jpackageoptions: >
--app-version "${{ needs.metadata.outputs.semVerNum }}"
--java-options "-Dfile.encoding=\"utf-8\""
+ --java-options "-Dapple.awt.enableTemplateImages=true"
--java-options "-Dcryptomator.logDir=\"~/Library/Logs/Cryptomator\""
--java-options "-Dcryptomator.pluginDir=\"~/Library/Application Support/Cryptomator/Plugins\""
--java-options "-Dcryptomator.settingsPath=\"~/Library/Application Support/Cryptomator/settings.json\""
diff --git a/.idea/runConfigurations/Cryptomator_macOS.xml b/.idea/runConfigurations/Cryptomator_macOS.xml
index 203d94d2d..25fba1930 100644
--- a/.idea/runConfigurations/Cryptomator_macOS.xml
+++ b/.idea/runConfigurations/Cryptomator_macOS.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/.idea/runConfigurations/Cryptomator_macOS_Dev.xml b/.idea/runConfigurations/Cryptomator_macOS_Dev.xml
index b889ebd69..ca385e6cc 100644
--- a/.idea/runConfigurations/Cryptomator_macOS_Dev.xml
+++ b/.idea/runConfigurations/Cryptomator_macOS_Dev.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/src/main/java/org/cryptomator/ui/traymenu/TrayIconController.java b/src/main/java/org/cryptomator/ui/traymenu/TrayIconController.java
index 6b87ab59a..2c176df76 100644
--- a/src/main/java/org/cryptomator/ui/traymenu/TrayIconController.java
+++ b/src/main/java/org/cryptomator/ui/traymenu/TrayIconController.java
@@ -2,9 +2,6 @@ package org.cryptomator.ui.traymenu;
import com.google.common.base.Preconditions;
import org.apache.commons.lang3.SystemUtils;
-import org.cryptomator.integrations.uiappearance.Theme;
-import org.cryptomator.integrations.uiappearance.UiAppearanceException;
-import org.cryptomator.integrations.uiappearance.UiAppearanceProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -12,38 +9,25 @@ import javax.inject.Inject;
import java.awt.AWTException;
import java.awt.SystemTray;
import java.awt.TrayIcon;
-import java.util.Optional;
@TrayMenuScoped
public class TrayIconController {
private static final Logger LOG = LoggerFactory.getLogger(TrayIconController.class);
- private final TrayImageFactory imageFactory;
- private final Optional appearanceProvider;
private final TrayMenuController trayMenuController;
private final TrayIcon trayIcon;
private volatile boolean initialized;
@Inject
- TrayIconController(TrayImageFactory imageFactory, TrayMenuController trayMenuController, Optional appearanceProvider) {
+ TrayIconController(TrayImageFactory imageFactory, TrayMenuController trayMenuController) {
this.trayMenuController = trayMenuController;
- this.imageFactory = imageFactory;
- this.appearanceProvider = appearanceProvider;
this.trayIcon = new TrayIcon(imageFactory.loadImage(), "Cryptomator", trayMenuController.getMenu());
}
public synchronized void initializeTrayIcon() throws IllegalStateException {
Preconditions.checkState(!initialized);
- appearanceProvider.ifPresent(appearanceProvider -> {
- try {
- appearanceProvider.addListener(this::systemInterfaceThemeChanged);
- } catch (UiAppearanceException e) {
- LOG.error("Failed to enable automatic tray icon theme switching.");
- }
- });
-
trayIcon.setImageAutoSize(true);
if (SystemUtils.IS_OS_WINDOWS) {
trayIcon.addActionListener(trayMenuController::showMainWindow);
@@ -61,10 +45,6 @@ public class TrayIconController {
this.initialized = true;
}
- private void systemInterfaceThemeChanged(Theme theme) {
- trayIcon.setImage(imageFactory.loadImage()); // TODO refactor "theme" is re-queried in loadImage()
- }
-
public boolean isInitialized() {
return initialized;
}
diff --git a/src/main/java/org/cryptomator/ui/traymenu/TrayImageFactory.java b/src/main/java/org/cryptomator/ui/traymenu/TrayImageFactory.java
index d9fcdfc29..aa55ca766 100644
--- a/src/main/java/org/cryptomator/ui/traymenu/TrayImageFactory.java
+++ b/src/main/java/org/cryptomator/ui/traymenu/TrayImageFactory.java
@@ -25,11 +25,7 @@ class TrayImageFactory {
}
private String getMacResourceName() {
- var theme = appearanceProvider.map(UiAppearanceProvider::getSystemTheme).orElse(Theme.LIGHT);
- return switch (theme) {
- case DARK -> "/img/tray_icon_mac_white.png";
- case LIGHT -> "/img/tray_icon_mac_black.png";
- };
+ return "/img/tray_icon_mac.png";
}
private String getWinOrLinuxResourceName() {
diff --git a/src/main/resources/img/tray_icon_mac.png b/src/main/resources/img/tray_icon_mac.png
new file mode 100755
index 000000000..b0f2c7894
Binary files /dev/null and b/src/main/resources/img/tray_icon_mac.png differ
diff --git a/src/main/resources/img/tray_icon_mac@2x.png b/src/main/resources/img/tray_icon_mac@2x.png
new file mode 100755
index 000000000..a6cdd32b9
Binary files /dev/null and b/src/main/resources/img/tray_icon_mac@2x.png differ
diff --git a/src/main/resources/img/tray_icon_mac_black.png b/src/main/resources/img/tray_icon_mac_black.png
deleted file mode 100644
index 42d6aad40..000000000
Binary files a/src/main/resources/img/tray_icon_mac_black.png and /dev/null differ
diff --git a/src/main/resources/img/tray_icon_mac_black@2x.png b/src/main/resources/img/tray_icon_mac_black@2x.png
deleted file mode 100644
index c93a96579..000000000
Binary files a/src/main/resources/img/tray_icon_mac_black@2x.png and /dev/null differ
diff --git a/src/main/resources/img/tray_icon_mac_white.png b/src/main/resources/img/tray_icon_mac_white.png
deleted file mode 100644
index d178cd017..000000000
Binary files a/src/main/resources/img/tray_icon_mac_white.png and /dev/null differ
diff --git a/src/main/resources/img/tray_icon_mac_white@2x.png b/src/main/resources/img/tray_icon_mac_white@2x.png
deleted file mode 100644
index 8c721bbce..000000000
Binary files a/src/main/resources/img/tray_icon_mac_white@2x.png and /dev/null differ