diff --git a/src/main/java/org/cryptomator/ui/common/SystemBarUtil.java b/src/main/java/org/cryptomator/ui/common/SystemBarUtil.java index 2f676ee43..9faaa60db 100644 --- a/src/main/java/org/cryptomator/ui/common/SystemBarUtil.java +++ b/src/main/java/org/cryptomator/ui/common/SystemBarUtil.java @@ -2,20 +2,48 @@ package org.cryptomator.ui.common; import javafx.stage.Screen; +/** + * Utility class providing methods regarding the OS bar. + */ public class SystemBarUtil { public enum Placement { + /** + * OS Bar placed at the left screen edge + */ LEFT, + /** + * OS Bar placed at the top screen edge + */ TOP, + /** + * OS Bar placed at the right screen edge + */ RIGHT, + /** + * OS Bar placed at the bottom screen edge + */ BOTTOM; } + /** + * Determines the placement of the OS bar on the given screen. + *
+ * Assuming the OS bar fills one screen edge completely, + * this method determines that screen edge by comparing the actual screen bounds with the visual ones. + *
+ * If the screen does not have a system bar, the bottom placement is returned.
+ * If the screen does have multiple system bars, the first in following priority is returned:
+ * LEFT, TOP, RIGHT, BOTTOM.
+ *
+ * @param screen a {@link Screen} where an OS bar exists
+ * @return {@link Placement} indicating the screen edge.
+ */
public static Placement getPlacementOfSystembar(Screen screen) {
var bounds = screen.getBounds();
var vBounds = screen.getVisualBounds();
//assumption: the system bar fills a whole screen side
- if(bounds.getMinX() != vBounds.getMinX()){
+ if (bounds.getMinX() != vBounds.getMinX()) {
return Placement.LEFT;
} else if (bounds.getMinY() != vBounds.getMinY()) {
return Placement.TOP;
diff --git a/src/main/java/org/cryptomator/ui/notification/NotificationController.java b/src/main/java/org/cryptomator/ui/notification/NotificationController.java
index 229fcb3a9..7bdf52541 100644
--- a/src/main/java/org/cryptomator/ui/notification/NotificationController.java
+++ b/src/main/java/org/cryptomator/ui/notification/NotificationController.java
@@ -1,6 +1,5 @@
package org.cryptomator.ui.notification;
-import org.cryptomator.cryptofs.event.FilesystemEvent;
import org.cryptomator.event.VaultEvent;
import org.cryptomator.ui.common.FxController;
import org.cryptomator.ui.fxapp.FxNotificationRadar;
@@ -25,6 +24,8 @@ import java.util.concurrent.ExecutorService;
@NotificationScoped
public class NotificationController implements FxController {
+ private static final String BUG_MSG = "IF YOU SEE THIS MESSAGE, PLEASE CONTACT THE DEVELOPERS OF CRYPTOMATOR ABOUT A BUG IN THE NOTIFICATION DISPLAY";
+
private final Stage window;
private final SimpleListProperty