mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 17:10:27 +00:00
Small fixes
This commit is contained in:
parent
9cb0b7f494
commit
0f8a8a3d02
5 changed files with 40 additions and 23 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue