Appearance fixes

This commit is contained in:
crschnick 2023-11-18 05:08:46 +00:00
parent 56bd49b932
commit 76c29f719b
8 changed files with 29 additions and 8 deletions

View file

@ -72,7 +72,7 @@ public class LoadingOverlayComp extends Comp<CompStructure<StackPane>> {
}
}
};
PlatformThread.sync(showLoading).addListener(listener);
showLoading.addListener(listener);
var stack = new StackPane(r, loadingOverlay);

View file

@ -3,10 +3,7 @@ package io.xpipe.app.comp.store;
import io.xpipe.app.comp.base.ErrorOverlayComp;
import io.xpipe.app.comp.base.MultiStepComp;
import io.xpipe.app.comp.base.PopupMenuButtonComp;
import io.xpipe.app.core.AppExtensionManager;
import io.xpipe.app.core.AppFont;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.core.AppWindowHelper;
import io.xpipe.app.core.*;
import io.xpipe.app.core.mode.OperationMode;
import io.xpipe.app.ext.DataStoreProvider;
import io.xpipe.app.fxcomps.Comp;

View file

@ -62,10 +62,15 @@ public class AppWindowHelper {
stage.setTitle(title);
addIcons(stage);
setupContent(stage, contentFunc, bindSize, loading);
AppTheme.initThemeHandlers(stage);
setupStylesheets(stage.getScene());
stage.setOnShown(e -> {
// If we set the theme pseudo classes earlier when the window is not shown
// they do not apply. Is this a bug in JavaFX?
Platform.runLater(() -> {
AppTheme.initThemeHandlers(stage);
});
centerToMainWindow(stage);
});
return stage;

View file

@ -63,6 +63,8 @@ public class ChoicePaneComp extends Comp<CompStructure<VBox>> {
} else {
vbox.getChildren().set(1, region);
}
region.requestFocus();
}
});

View file

@ -57,6 +57,12 @@ public class FileStoreChoiceComp extends SimpleComp {
var layout = new HorizontalComp(List.of(fileSystemChoiceComp, fileNameComp, fileBrowseButton))
.apply(struc -> struc.get().setFillHeight(true));
layout.apply(struc -> {
struc.get().focusedProperty().addListener((observable, oldValue, newValue) -> {
struc.get().getChildren().get(1).requestFocus();
});
});
return layout.createRegion();
}
}

View file

@ -49,11 +49,16 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
var nameRegions = new ArrayList<Region>();
Region firstComp = null;
for (var entry : getEntries()) {
Region compRegion = null;
if (entry.comp() != null) {
compRegion = entry.comp().createRegion();
}
if (firstComp == null) {
firstComp = compRegion;
}
if (entry.name() != null && entry.description() != null) {
var line = new VBox();
@ -162,6 +167,13 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
nameRegions.forEach(r -> r.minWidthProperty().bind(nameWidthBinding));
}
Region finalFirstComp = firstComp;
pane.focusedProperty().addListener((observable, oldValue, newValue) -> {
if (finalFirstComp != null && newValue) {
finalFirstComp.requestFocus();
}
});
return new SimpleCompStructure<>(pane);
}

View file

@ -54,7 +54,6 @@ public class SecretRetrievalStrategyHelper {
new SimpleObjectProperty<>(p.getValue() != null ? p.getValue().getCommand() : null);
var content = new TextFieldComp(cmdProperty);
return new OptionsBuilder()
.name("command")
.addComp(content, cmdProperty)
.bind(
() -> {

View file

@ -82,7 +82,7 @@ developerModeDescription=When enabled, you will have access to a variety of addi
editor=Editor
custom=Custom
passwordManagerCommand=Password manager command
passwordManagerCommandDescription=The command to execute to fetch passwords. The placeholder string $KEY will be replaced by the quoted password key when called. This should call your password manager CLI to print the password to stdout, e.g. mypassmgr get $KEY.\n\nYou can check here whether the output is correct. The command should only output the password itself, no other formatting should be included in the output.
passwordManagerCommandDescription=The command to execute to fetch passwords. The placeholder string $KEY will be replaced by the quoted password key when called. This should call your password manager CLI to print the password to stdout, e.g. mypassmgr get $KEY.\n\nYou can test below whether the output is correct. The command should only output the password itself, no other formatting should be included in the output.
preferEditorTabs=Prefer to open new tabs
preferEditorTabsDescription=Controls whether XPipe will try to open new tabs in your chosen editor instead of new windows.
customEditorCommand=Custom editor command