diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java index 7a3342a80..f784fe6f3 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java @@ -57,10 +57,9 @@ public class BrowserStatusBarComp extends SimpleComp { if (p == null || p.done()) { return null; } else { - var time = - p.getTotal() > 50_000_000 && p.elapsedTime().compareTo(Duration.of(200, ChronoUnit.MILLIS)) > 0 - ? HumanReadableFormat.duration(p.expectedTimeRemaining()) - : "..."; + var expected = p.expectedTimeRemaining(); + var show = (p.getTotal() > 50_000_000 && p.elapsedTime().compareTo(Duration.of(200, ChronoUnit.MILLIS)) > 0) || expected.toMillis() > 5000; + var time = show ? HumanReadableFormat.duration(p.expectedTimeRemaining()) : "..."; return time; } }); diff --git a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java index 23d8d102f..907ead2c8 100644 --- a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java +++ b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java @@ -51,8 +51,6 @@ public class BrowserSessionTabsComp extends SimpleComp { public Region createSimple() { var multi = new MultiContentComp(Map., ObservableValue>of( - Comp.hspacer().styleClass("top-spacer"), - new SimpleBooleanProperty(true), Comp.of(() -> createTabPane()), Bindings.isNotEmpty(model.getSessionEntries()), new BrowserWelcomeComp(model).apply(struc -> StackPane.setAlignment(struc.get(), Pos.CENTER_LEFT)), @@ -60,7 +58,9 @@ public class BrowserSessionTabsComp extends SimpleComp { () -> { return model.getSessionEntries().size() == 0; }, - model.getSessionEntries()))); + model.getSessionEntries()), + Comp.hspacer().styleClass("top-spacer"), + new SimpleBooleanProperty(true))); multi.apply(struc -> ((StackPane) struc.get()).setAlignment(Pos.TOP_CENTER)); return multi.createRegion(); } diff --git a/app/src/main/java/io/xpipe/app/core/App.java b/app/src/main/java/io/xpipe/app/core/App.java index b3c7912ea..6abc9947d 100644 --- a/app/src/main/java/io/xpipe/app/core/App.java +++ b/app/src/main/java/io/xpipe/app/core/App.java @@ -2,17 +2,14 @@ package io.xpipe.app.core; import io.xpipe.app.comp.AppLayoutComp; import io.xpipe.app.core.window.AppMainWindow; -import io.xpipe.app.core.window.AppWindowHelper; import io.xpipe.app.fxcomps.util.PlatformThread; import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.update.XPipeDistributionType; import io.xpipe.app.util.LicenseProvider; - import javafx.application.Application; import javafx.beans.binding.Bindings; import javafx.stage.Stage; - import lombok.Getter; import lombok.SneakyThrows; @@ -32,8 +29,6 @@ public class App extends Application { TrackEvent.info("Application launched"); APP = this; stage = primaryStage; - stage.opacityProperty().bind(AppPrefs.get().windowOpacity()); - AppWindowHelper.addIcons(stage); } public void setupWindow() { diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index bfc1c8308..017c4cf75 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -59,11 +59,13 @@ public class AppTheme { } stage.getScene().getRoot().getStyleClass().add(t.getCssId()); - stage.getScene().getStylesheets().removeAll(t.getAdditionalStylesheets()); stage.getScene().getStylesheets().addAll(t.getAdditionalStylesheets()); stage.getScene().getRoot().pseudoClassStateChanged(LIGHT, !t.isDark()); stage.getScene().getRoot().pseudoClassStateChanged(DARK, t.isDark()); }); + AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> { + stage.getScene().getStylesheets().removeAll(oldValue.getAdditionalStylesheets()); + }); AppPrefs.get().performanceMode().subscribe(val -> { stage.getScene().getRoot().pseudoClassStateChanged(PRETTY, !val); diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 72f2147a4..e374c046e 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -54,6 +54,8 @@ public class AppMainWindow { scene.setFill(Color.TRANSPARENT); ModifiedStage.prepareStage(stage); stage.setScene(scene); + stage.opacityProperty().bind(AppPrefs.get().windowOpacity()); + AppWindowHelper.addIcons(stage); AppWindowHelper.setupStylesheets(stage.getScene()); return INSTANCE; } diff --git a/app/src/main/java/io/xpipe/app/util/PlatformState.java b/app/src/main/java/io/xpipe/app/util/PlatformState.java index 377ba10b0..559140ba6 100644 --- a/app/src/main/java/io/xpipe/app/util/PlatformState.java +++ b/app/src/main/java/io/xpipe/app/util/PlatformState.java @@ -49,10 +49,10 @@ public enum PlatformState { setCurrent(PlatformState.EXITED); } - public static void initPlatformOrThrow() throws Exception { + public static void initPlatformOrThrow() throws Throwable { initPlatformIfNeeded(); if (lastError != null) { - throw lastError instanceof Exception e ? e : new Exception(lastError); + throw getLastError(); } } diff --git a/app/src/main/java/io/xpipe/app/util/UnlockAlert.java b/app/src/main/java/io/xpipe/app/util/UnlockAlert.java index 1c3381970..e13427780 100644 --- a/app/src/main/java/io/xpipe/app/util/UnlockAlert.java +++ b/app/src/main/java/io/xpipe/app/util/UnlockAlert.java @@ -18,7 +18,7 @@ import javafx.stage.Stage; public class UnlockAlert { - public static void showIfNeeded() throws Exception { + public static void showIfNeeded() throws Throwable { if (AppPrefs.get().getLockCrypt().getValue() == null || AppPrefs.get().getLockCrypt().getValue().isEmpty()) { return; diff --git a/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css b/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css index 37894e7f6..10a77eb29 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css @@ -90,10 +90,6 @@ -fx-opacity: 0.2; } -.root:pretty .store-entry-comp .button-bar, .root:pretty .store-entry-comp .dropdown-comp { - -fx-effect: dropshadow(three-pass-box, -color-shadow-default, 2px, 0.25, 0, 1); -} - .store-entry-comp .button-bar .button { -fx-padding: 6px; } diff --git a/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoDark.css b/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoDark.css index c60247759..3a35500f7 100644 --- a/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoDark.css +++ b/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoDark.css @@ -1 +1,5 @@ -.root { -color-bg-default-transparent: #1C1C1ED2; } \ No newline at end of file +.root { -color-bg-default-transparent: #1C1C1ED2; } + +.root.cupertino .button { + -fx-effect: NONE; +} diff --git a/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoLight.css b/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoLight.css index fbbefc2be..2f4885598 100644 --- a/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoLight.css +++ b/app/src/main/resources/io/xpipe/app/resources/theme/cupertinoLight.css @@ -1 +1,5 @@ -.root { -color-bg-default-transparent: #FFFFFFCC; } \ No newline at end of file +.root { -color-bg-default-transparent: #FFFFFFCC; } + +.root.cupertino .button { + -fx-effect: NONE; +}