diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserSelectionListComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserSelectionListComp.java index de41cf583..93ae14cec 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserSelectionListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserSelectionListComp.java @@ -9,6 +9,7 @@ import io.xpipe.app.fxcomps.SimpleComp; import io.xpipe.app.fxcomps.impl.PrettyImageHelper; import io.xpipe.app.fxcomps.util.PlatformThread; +import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ObservableValue; import javafx.collections.ObservableList; @@ -63,8 +64,9 @@ public class BrowserSelectionListComp extends SimpleComp { return l; }); }, - false) - .styleClass("selected-file-list"); + true) + .styleClass("selected-file-list") + .hide(Bindings.isEmpty(list)); return c.createRegion(); } } diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserTransferComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserTransferComp.java index 6a7bedf3e..5d04c088a 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserTransferComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserTransferComp.java @@ -3,6 +3,7 @@ package io.xpipe.app.browser; import io.xpipe.app.browser.file.BrowserFileTransferMode; import io.xpipe.app.browser.fs.OpenFileSystemModel; import io.xpipe.app.comp.base.LoadingOverlayComp; +import io.xpipe.app.core.AppFont; import io.xpipe.app.core.AppI18n; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.SimpleComp; @@ -10,16 +11,13 @@ import io.xpipe.app.fxcomps.augment.DragOverPseudoClassAugment; import io.xpipe.app.fxcomps.impl.*; import io.xpipe.app.fxcomps.util.DerivedObservableList; import io.xpipe.app.fxcomps.util.PlatformThread; - import javafx.beans.binding.Bindings; import javafx.collections.FXCollections; import javafx.geometry.Insets; import javafx.scene.image.Image; import javafx.scene.input.Dragboard; import javafx.scene.input.TransferMode; -import javafx.scene.layout.AnchorPane; import javafx.scene.layout.Region; - import org.kordamp.ikonli.javafx.FontIcon; import java.io.File; @@ -77,9 +75,8 @@ public class BrowserTransferComp extends SimpleComp { var dragNotice = new LabelComp(syncAllDownloaded.flatMap( aBoolean -> aBoolean ? AppI18n.observable("dragLocalFiles") : AppI18n.observable("dragFiles"))) .apply(struc -> struc.get().setGraphic(new FontIcon("mdi2h-hand-left"))) - .hide(Bindings.isEmpty(syncItems)) - .grow(true, false) - .apply(struc -> struc.get().setPadding(new Insets(8))); + .apply(struc -> AppFont.medium(struc.get())) + .hide(Bindings.isEmpty(syncItems)); var downloadButton = new IconButtonComp("mdi2d-download", () -> { model.download(); @@ -91,23 +88,15 @@ public class BrowserTransferComp extends SimpleComp { model.clear(); }) .hide(Bindings.isEmpty(syncItems)); - var clearPane = Comp.derive( - new HorizontalComp(List.of(downloadButton, clearButton)) - .apply(struc -> struc.get().setSpacing(10)), - button -> { - var p = new AnchorPane(button); - AnchorPane.setRightAnchor(button, 10.0); - AnchorPane.setTopAnchor(button, 10.0); - p.setPickOnBounds(false); - return p; - }); - var listBox = new VerticalComp(List.of(list, dragNotice)) + var bottom = new HorizontalComp(List.of(dragNotice, Comp.hspacer(), downloadButton, Comp.hspacer(4), clearButton)); + var listBox = new VerticalComp(List.of(list, bottom)) + .spacing(5) .padding(new Insets(10, 10, 5, 10)) .apply(struc -> struc.get().setMinHeight(200)) .apply(struc -> struc.get().setMaxHeight(200)); var stack = LoadingOverlayComp.noProgress( - new StackComp(List.of(backgroundStack, listBox, clearPane)) + new StackComp(List.of(backgroundStack, listBox)) .apply(DragOverPseudoClassAugment.create()) .apply(struc -> { struc.get().setOnDragOver(event -> { diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java index a125f1230..aa6d6c04d 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java @@ -366,7 +366,12 @@ public class StoreCreationComp extends DialogComp { .description("connectionNameDescription") .addString(name, false) .nonNull(propVal) - .build(); + .buildComp() + .onSceneAssign(struc -> { + if (staticDisplay) { + struc.get().requestFocus(); + } + }).createRegion(); } private void commit(boolean validated) { @@ -391,9 +396,10 @@ public class StoreCreationComp extends DialogComp { var providerChoice = new StoreProviderChoiceComp(filter, provider, staticDisplay); if (staticDisplay) { providerChoice.apply(struc -> struc.get().setDisable(true)); + } else { + providerChoice.onSceneAssign(struc -> struc.get().requestFocus()); } providerChoice.apply(GrowAugment.create(true, false)); - providerChoice.onSceneAssign(struc -> struc.get().requestFocus()); provider.subscribe(n -> { if (n != null) { diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/DataStoreChoiceComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/DataStoreChoiceComp.java index 13702de4b..846459c2b 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/DataStoreChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/DataStoreChoiceComp.java @@ -228,6 +228,11 @@ public class DataStoreChoiceComp extends SimpleComp { icon.setPickOnBounds(false); AppFont.header(icon); var pane = new StackPane(r, icon); + pane.focusedProperty().addListener((observable, oldValue, newValue) -> { + if (newValue) { + r.requestFocus(); + } + }); StackPane.setMargin(icon, new Insets(10)); pane.setPickOnBounds(false); StackPane.setAlignment(icon, Pos.CENTER_RIGHT); diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/VerticalComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/VerticalComp.java index 5c6ec4c80..2ea9c4a2e 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/VerticalComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/VerticalComp.java @@ -4,7 +4,6 @@ import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.CompStructure; import io.xpipe.app.fxcomps.SimpleCompStructure; import io.xpipe.app.fxcomps.util.PlatformThread; - import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; @@ -24,6 +23,10 @@ public class VerticalComp extends Comp> { this.entries = PlatformThread.sync(entries); } + public Comp> spacing(double spacing) { + return apply(struc -> struc.get().setSpacing(spacing)); + } + @Override public CompStructure createBase() { VBox b = new VBox(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java index c5d22dad9..dedc7212c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java @@ -16,7 +16,7 @@ public class FixedServiceStoreProvider extends AbstractServiceStoreProvider { FixedServiceStore s = store.getStore().asNeeded(); return DataStorage.get() .getOrCreateNewSyntheticEntry( - s.getHost().get(), + s.getDisplayParent().get(), "Services", FixedServiceGroupStore.builder() .parent(s.getDisplayParent().get().ref()) diff --git a/ext/base/src/main/java/module-info.java b/ext/base/src/main/java/module-info.java index 15ecf6034..91b56b2d1 100644 --- a/ext/base/src/main/java/module-info.java +++ b/ext/base/src/main/java/module-info.java @@ -67,7 +67,6 @@ open module io.xpipe.ext.base { LaunchStoreAction, XPipeUrlAction, EditStoreAction, - DeleteChildrenStoreAction, BrowseStoreAction, ScanStoreAction; provides DataStoreProvider with