Skip to content

Commit b58ecc6

Browse files
committed
Merge branch 'release/1.3.0'
2 parents 5c7515f + c463221 commit b58ecc6

File tree

7 files changed

+44
-25
lines changed

7 files changed

+44
-25
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
name: artifacts
2525
path: target/*.jar
2626
- name: Create Release
27-
uses: actions/create-release@v1 # NOTE: action is unmaintained and repo archived
27+
uses: softprops/action-gh-release@v1
2828
if: startsWith(github.ref, 'refs/tags/')
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
3129
with:
32-
tag_name: ${{ github.ref }}
33-
release_name: Release ${{ github.ref }}
34-
prerelease: true
30+
prerelease: true
31+
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
32+
generate_release_notes: true

.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>integrations-api</artifactId>
8-
<version>1.2.0</version>
8+
<version>1.3.0</version>
99

1010
<name>Cryptomator Integrations API</name>
1111
<description>Defines optional service interfaces that may be used by Cryptomator</description>
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
/**
22
* Mount service package
33
*/
4-
@ApiStatus.Experimental
5-
package org.cryptomator.integrations.mount;
6-
7-
import org.jetbrains.annotations.ApiStatus;
4+
package org.cryptomator.integrations.mount;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.cryptomator.integrations.tray;
2+
3+
import org.jetbrains.annotations.ApiStatus;
4+
5+
/**
6+
* A callback used by the {@link TrayMenuController} to load tray icons in the format required by the implementation.
7+
*/
8+
@ApiStatus.Experimental
9+
sealed public interface TrayIconLoader permits TrayIconLoader.PngData, TrayIconLoader.FreedesktopIconName {
10+
11+
@FunctionalInterface
12+
non-sealed interface PngData extends TrayIconLoader {
13+
14+
/**
15+
* Loads an icon from a byte array holding a loaded PNG file.
16+
*
17+
* @param data png data
18+
*/
19+
void loadPng(byte[] data);
20+
}
21+
22+
@FunctionalInterface
23+
non-sealed interface FreedesktopIconName extends TrayIconLoader {
24+
25+
/**
26+
* Loads an icon by looking it up {@code iconName} inside of {@code $XDG_DATA_DIRS/icons}.
27+
*
28+
* @param iconName the icon name
29+
*/
30+
void lookupByName(String iconName);
31+
}
32+
}

src/main/java/org/cryptomator/integrations/tray/TrayMenuController.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
import org.cryptomator.integrations.common.IntegrationsLoader;
44
import org.jetbrains.annotations.ApiStatus;
55

6-
import java.io.IOException;
7-
import java.io.InputStream;
86
import java.util.List;
97
import java.util.Optional;
8+
import java.util.function.Consumer;
109

1110
/**
1211
* Displays a tray icon and menu
@@ -23,20 +22,20 @@ static Optional<TrayMenuController> get() {
2322
/**
2423
* Displays an icon on the system tray.
2524
*
26-
* @param imageData What image to show
25+
* @param iconLoader A callback responsible for retrieving the icon in the required format
2726
* @param defaultAction Action to perform when interacting with the icon directly instead of its menu
2827
* @param tooltip Text shown when hovering
2928
* @throws TrayMenuException thrown when adding the tray icon failed
3029
*/
31-
void showTrayIcon(byte[] imageData, Runnable defaultAction, String tooltip) throws TrayMenuException;
30+
void showTrayIcon(Consumer<TrayIconLoader> iconLoader, Runnable defaultAction, String tooltip) throws TrayMenuException;
3231

3332
/**
3433
* Updates the icon on the system tray.
3534
*
36-
* @param imageData What image to show
35+
* @param iconLoader A callback responsible for retrieving the icon in the required format
3736
* @throws IllegalStateException thrown when called before an icon has been added
3837
*/
39-
void updateTrayIcon(byte[] imageData);
38+
void updateTrayIcon(Consumer<TrayIconLoader> iconLoader);
4039

4140
/**
4241
* Show the given options in the tray menu.

0 commit comments

Comments
 (0)