mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-26 10:25:44 +00:00
Rework
This commit is contained in:
@@ -110,8 +110,8 @@ public class IntegratedTextAreaComp extends RegionStructureBuilder<AnchorPane, I
|
||||
var copyButton = createOpenButton();
|
||||
var pane = new AnchorPane(textAreaStruc.get(), copyButton);
|
||||
pane.setPickOnBounds(false);
|
||||
AnchorPane.setTopAnchor(copyButton, 7.0);
|
||||
AnchorPane.setRightAnchor(copyButton, 7.0);
|
||||
AnchorPane.setTopAnchor(copyButton, 4.0);
|
||||
AnchorPane.setRightAnchor(copyButton, 4.0);
|
||||
AnchorPane.setLeftAnchor(textAreaStruc.get(), 0.0);
|
||||
AnchorPane.setRightAnchor(textAreaStruc.get(), 0.0);
|
||||
pane.maxHeightProperty().bind(textAreaStruc.get().heightProperty());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.xpipe.app.hub.comp;
|
||||
|
||||
import atlantafx.base.controls.Spacer;
|
||||
import io.xpipe.app.comp.RegionBuilder;
|
||||
import io.xpipe.app.comp.SimpleRegionBuilder;
|
||||
import io.xpipe.app.comp.augment.ContextMenuAugment;
|
||||
@@ -27,9 +28,11 @@ import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyCodeCombination;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import javafx.scene.layout.Background;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.Region;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
import org.kordamp.ikonli.javafx.FontIcon;
|
||||
@@ -289,6 +292,7 @@ public class StoreCategoryComp extends SimpleRegionBuilder {
|
||||
l.setText(storeCategoryWrapper.getName().getValue());
|
||||
l.setPadding(new Insets(0, 1, 1, storeCategoryWrapper.getDepth() * 10));
|
||||
m.setContent(l);
|
||||
l.prefWidthProperty().bind(contextMenu.widthProperty().subtract(40));
|
||||
|
||||
m.setOnAction(event -> {
|
||||
category.moveToParent(storeCategoryWrapper.getCategory());
|
||||
|
||||
@@ -660,6 +660,7 @@ public abstract class StoreEntryComp extends SimpleRegionBuilder {
|
||||
l.setText(storeCategoryWrapper.getName().getValue());
|
||||
l.setPadding(new Insets(0, 1, 1, storeCategoryWrapper.getDepth() * 10));
|
||||
m.setContent(l);
|
||||
l.prefWidthProperty().bind(contextMenu.widthProperty().subtract(40));
|
||||
|
||||
m.setOnAction(event -> {
|
||||
getWrapper().moveTo(storeCategoryWrapper.getCategory());
|
||||
|
||||
@@ -172,18 +172,12 @@ public abstract class StoreSectionBaseComp extends RegionBuilder<VBox> {
|
||||
}
|
||||
|
||||
protected RegionBuilder<Button> createQuickAccessButton(int width, Consumer<StoreSection> r) {
|
||||
var quickAccessDisabled = Bindings.createBooleanBinding(
|
||||
() -> {
|
||||
return section.getShownChildren().getList().isEmpty();
|
||||
},
|
||||
section.getShownChildren().getList());
|
||||
var quickAccessButton = new StoreQuickAccessButtonComp(section, r)
|
||||
.style("quick-access-button")
|
||||
.minWidth(width)
|
||||
.prefWidth(width)
|
||||
.maxHeight(100)
|
||||
.describe(d -> d.nameKey("quickAccess"))
|
||||
.disable(quickAccessDisabled);
|
||||
.describe(d -> d.nameKey("quickAccess"));
|
||||
return quickAccessButton;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,16 +75,6 @@ public class StoreSectionComp extends StoreSectionBaseComp {
|
||||
});
|
||||
});
|
||||
|
||||
var quickAccessButton = createQuickAccessButton(30, c -> {
|
||||
ThreadHelper.runFailableAsync(() -> {
|
||||
c.getWrapper().executeDefaultAction();
|
||||
});
|
||||
});
|
||||
quickAccessButton.vgrow();
|
||||
quickAccessButton.describe(d -> d.nameKey("quickAccess")
|
||||
.focusTraversal(RegionDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)
|
||||
.shortcut(new KeyCodeCombination(KeyCode.RIGHT)));
|
||||
|
||||
var expandButton = createExpandButton(
|
||||
() -> section.getWrapper().toggleExpanded(),
|
||||
30,
|
||||
@@ -95,6 +85,17 @@ public class StoreSectionComp extends StoreSectionBaseComp {
|
||||
.shortcut(new KeyCodeCombination(KeyCode.SPACE)));
|
||||
var buttonList = new ArrayList<BaseRegionBuilder<?, ?>>();
|
||||
if (entryButton.isFullSize()) {
|
||||
var quickAccessButton = createQuickAccessButton(30, c -> {
|
||||
ThreadHelper.runFailableAsync(() -> {
|
||||
c.getWrapper().executeDefaultAction();
|
||||
});
|
||||
});
|
||||
quickAccessButton.disable(Bindings.isEmpty(section.getShownChildren().getList()));
|
||||
quickAccessButton.vgrow();
|
||||
quickAccessButton.describe(d -> d.nameKey("quickAccess")
|
||||
.focusTraversal(RegionDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)
|
||||
.shortcut(new KeyCodeCombination(KeyCode.RIGHT)));
|
||||
|
||||
buttonList.add(quickAccessButton);
|
||||
}
|
||||
buttonList.add(expandButton);
|
||||
|
||||
@@ -87,12 +87,17 @@ public class StoreSectionMiniComp extends StoreSectionBaseComp {
|
||||
|
||||
var expandButton = createExpandButton(() -> expanded.set(!expanded.get()), 20, expanded);
|
||||
|
||||
var quickAccessButton = createQuickAccessButton(20, action);
|
||||
|
||||
var buttonList = new ArrayList<BaseRegionBuilder<?, ?>>();
|
||||
buttonList.add(expandButton);
|
||||
buttonList.add(root);
|
||||
if (section.getDepth() == 1) {
|
||||
var quickAccessButton = createQuickAccessButton(20, action);
|
||||
var quickAccessHidden = Bindings.createBooleanBinding(
|
||||
() -> {
|
||||
return expanded.get() || section.getShownChildren().getList().isEmpty();
|
||||
},
|
||||
expanded, section.getShownChildren().getList());
|
||||
quickAccessButton.hide(quickAccessHidden);
|
||||
buttonList.add(quickAccessButton);
|
||||
}
|
||||
var h = new HorizontalComp(buttonList);
|
||||
|
||||
@@ -359,6 +359,11 @@ public abstract class DataStorage {
|
||||
newEntry.setIcon(icon, true);
|
||||
}
|
||||
|
||||
var syntheticParent = getSyntheticParent(newEntry);
|
||||
if (syntheticParent.isPresent()) {
|
||||
addStoreEntryIfNotPresent(syntheticParent.get());
|
||||
}
|
||||
|
||||
var oldParent = getDefaultDisplayParent(entry);
|
||||
var newParent = getDefaultDisplayParent(newEntry);
|
||||
var sameParent = Objects.equals(oldParent, newParent);
|
||||
@@ -457,6 +462,11 @@ public abstract class DataStorage {
|
||||
}
|
||||
entry.setStoreInternal(store, false);
|
||||
|
||||
var syntheticParent = getSyntheticParent(entry);
|
||||
if (syntheticParent.isPresent()) {
|
||||
addStoreEntryIfNotPresent(syntheticParent.get());
|
||||
}
|
||||
|
||||
if (storeEntries.containsKey(entry)) {
|
||||
saveAsync();
|
||||
}
|
||||
|
||||
@@ -73,7 +73,6 @@ public enum DocumentationLink {
|
||||
SSH_NO_ROUTE("troubleshoot/ssh#no-route-to-host"),
|
||||
SSH_AGENT_REFUSAL("troubleshoot/ssh#agent-refused-operation"),
|
||||
SSH_CONNECTION_TIMEOUT("troubleshoot/ssh#connection-timeout"),
|
||||
SSH_SHELL_TIMEOUT("troubleshoot/ssh#shell-timeout"),
|
||||
SSH_CONFIG("guide/ssh#config-files"),
|
||||
SSH_KEYS("guide/ssh#key-based-authentication"),
|
||||
SSH_OPTIONS("guide/ssh#adding-ssh-options"),
|
||||
|
||||
Reference in New Issue
Block a user