diff --git a/app/src/main/java/io/xpipe/app/browser/FileBrowserModel.java b/app/src/main/java/io/xpipe/app/browser/FileBrowserModel.java index 748c0019..94034ef0 100644 --- a/app/src/main/java/io/xpipe/app/browser/FileBrowserModel.java +++ b/app/src/main/java/io/xpipe/app/browser/FileBrowserModel.java @@ -104,9 +104,9 @@ public class FileBrowserModel { openFileSystems.add(model); selected.setValue(model); if (path != null) { - model.cd(path); + model.initWithGivenDirectory(path); } else { - model.initDirectory(); + model.initWithDefaultDirectory(); } }); } diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java index c3e9b21f..131f2c6b 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java @@ -335,25 +335,33 @@ public final class OpenFileSystemModel { }); } - public void initDirectory() throws Exception { - BusyProperty.execute(busy, () -> { - var storageEntry = DataStorage.get() - .getStoreEntryIfPresent(store) - .map(entry -> entry.getUuid()) - .orElse(UUID.randomUUID()); - this.savedState.setValue( - AppCache.get("browser-state-" + storageEntry, OpenFileSystemSavedState.class, () -> { - try { - return OpenFileSystemSavedState.builder() - .lastDirectory(FileSystemHelper.getStartDirectory(this)) - .build(); - } catch (Exception e) { - ErrorEvent.fromThrowable(e).handle(); - return null; - } - })); - cdSyncWithoutCheck(this.savedState.getValue().getLastDirectory()); - }); + public void initWithGivenDirectory(String dir) throws Exception { + initSavedState(dir); + cdSyncWithoutCheck(dir); + } + + public void initWithDefaultDirectory() throws Exception { + var dir = FileSystemHelper.getStartDirectory(this); + initSavedState(dir); + cdSyncWithoutCheck(dir); + } + + private void initSavedState(String path) { + var storageEntry = DataStorage.get() + .getStoreEntryIfPresent(store) + .map(entry -> entry.getUuid()) + .orElse(UUID.randomUUID()); + this.savedState.setValue( + AppCache.get("browser-state-" + storageEntry, OpenFileSystemSavedState.class, () -> { + try { + return OpenFileSystemSavedState.builder() + .lastDirectory(path) + .build(); + } catch (Exception e) { + ErrorEvent.fromThrowable(e).handle(); + return null; + } + })); } public void openTerminalAsync(String directory) { 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 db68063e..c80b2a5a 100644 --- a/app/src/main/java/io/xpipe/app/core/App.java +++ b/app/src/main/java/io/xpipe/app/core/App.java @@ -73,7 +73,7 @@ public class App extends Application { var titleBinding = Bindings.createStringBinding( () -> { var base = String.format( - "X-Pipe Desktop (%s)", AppProperties.get().getVersion()); + "xpipe Desktop (%s)", AppProperties.get().getVersion()); var prefix = AppProperties.get().isStaging() ? "[STAGE] " : ""; var suffix = XPipeDistributionType.get().getUpdateHandler().getPreparedUpdate().getValue() != null ? String.format( 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 961121aa..83e341ae 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -77,6 +77,10 @@ public class AppTheme { } private static void changeTheme(Theme newTheme) { + if (newTheme == null) { + return; + } + PlatformThread.runLaterIfNeeded(() -> { for (Window window : Window.getWindows()) { var scene = window.getScene(); diff --git a/app/src/main/resources/io/xpipe/app/resources/style/browser.css b/app/src/main/resources/io/xpipe/app/resources/style/browser.css index 5c22fa96..52592675 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/browser.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/browser.css @@ -73,7 +73,7 @@ } .browser .status-bar { - -fx-border-width: 1 0 1 0; + -fx-border-width: 1 0 0 0; -fx-border-color: -color-neutral-muted; } @@ -126,6 +126,11 @@ -fx-border-color: -color-neutral-muted; } +.browser .tab-pane { + -fx-border-width: 0 0 0 1px; +-fx-border-color: -color-neutral-emphasis; +} + .chooser-bar { -fx-border-color: -color-neutral-emphasis; -fx-border-width: 0.1em 0 0 0;