Skip to content

Commit

Permalink
Appearance fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Nov 18, 2023
1 parent 56bd49b commit 76c29f7
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa
}
}
};
PlatformThread.sync(showLoading).addListener(listener);
showLoading.addListener(listener);

var stack = new StackPane(r, loadingOverlay);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
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;
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/io/xpipe/app/core/AppWindowHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ public static Stage sideWindow(
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public Entry fromString(String string) {
} else {
vbox.getChildren().set(1, region);
}

region.requestFocus();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ protected Region createSimple() {
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();
}
}
12 changes: 12 additions & 0 deletions app/src/main/java/io/xpipe/app/fxcomps/impl/OptionsComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ public CompStructure<Pane> createBase() {

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();
Expand Down Expand Up @@ -162,6 +167,13 @@ public CompStructure<Pane> createBase() {
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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private static OptionsBuilder customCommand(Property<SecretRetrievalStrategy.Cus
new SimpleObjectProperty<>(p.getValue() != null ? p.getValue().getCommand() : null);
var content = new TextFieldComp(cmdProperty);
return new OptionsBuilder()
.name("command")
.addComp(content, cmdProperty)
.bind(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76c29f7

Please sign in to comment.