diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkList.java b/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkList.java index 16b5498d9..aa12be152 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkList.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkList.java @@ -109,11 +109,11 @@ final class BrowserBookmarkList extends SimpleComp { mouseEvent.consume(); }); addEventHandler(MouseEvent.MOUSE_CLICKED, event -> { - if (getItem() == null || event.getButton() != MouseButton.PRIMARY) { + if (getItem() == null || event.getButton() != MouseButton.PRIMARY || (!getItem().getState().getValue().isUsable()) || !(getItem().getEntry() + .getStore() instanceof ShellStore fileSystem)) { return; } - var fileSystem = ((ShellStore) getItem().getEntry().getStore()); model.openFileSystemAsync(null, fileSystem, null, busy); event.consume(); }); diff --git a/app/src/main/java/io/xpipe/app/issue/ErrorHandlerComp.java b/app/src/main/java/io/xpipe/app/issue/ErrorHandlerComp.java index ea2e03d74..bfe160f06 100644 --- a/app/src/main/java/io/xpipe/app/issue/ErrorHandlerComp.java +++ b/app/src/main/java/io/xpipe/app/issue/ErrorHandlerComp.java @@ -18,7 +18,7 @@ import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.scene.control.Label; import javafx.scene.control.Separator; -import javafx.scene.control.TextField; +import javafx.scene.control.TextArea; import javafx.scene.layout.*; import javafx.scene.paint.Color; import javafx.stage.Stage; @@ -160,24 +160,28 @@ public class ErrorHandlerComp extends SimpleComp { var header = new Label(AppI18n.get(headerId)); AppFont.header(header); - var descriptionField = new TextField(limitedDescription); + var descriptionField = new TextArea(limitedDescription); + descriptionField.setPrefRowCount(4); + descriptionField.setWrapText(true); descriptionField.setEditable(false); descriptionField.setPadding(Insets.EMPTY); AppFont.small(descriptionField); var text = new VBox(header, descriptionField); + text.setFillWidth(true); text.setSpacing(2); var graphic = new FontIcon("mdomz-warning"); graphic.setIconColor(Color.RED); - var pane = new StackPane(graphic); - var hbox = new HBox(pane, text); + var graphicPane = new StackPane(graphic); + var hbox = new HBox(graphicPane, text); + HBox.setHgrow(text, Priority.ALWAYS); hbox.setSpacing(8); - pane.prefHeightProperty() + graphicPane.prefHeightProperty() .bind(Bindings.createDoubleBinding( () -> header.getHeight() + descriptionField.getHeight() + 2, header.heightProperty(), descriptionField.heightProperty())); - pane.prefHeightProperty().addListener((c, o, n) -> { + graphicPane.prefHeightProperty().addListener((c, o, n) -> { var size = Math.min(n.intValue(), 100); graphic.setIconSize(size); }); diff --git a/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties b/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties index 82009b925..5561da144 100644 --- a/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties +++ b/app/src/main/resources/io/xpipe/app/resources/lang/translations_en.properties @@ -27,7 +27,7 @@ deleteAlertTitle=Confirm deletion deleteAlertHeader=Do you want to delete the ($COUNT$) selected elements? selectedElements=Selected elements: mustNotBeEmpty=$NAME$ must not be empty -download=Drop to download +download=Drop to transfer dragFiles=Drag files from here null=$VALUE$ must be not null hostFeatureUnsupported=$FEATURE$ is not available on the host diff --git a/app/src/main/resources/io/xpipe/app/resources/style/browser.css b/app/src/main/resources/io/xpipe/app/resources/style/browser.css index 2985f0957..7c1602f23 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/browser.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/browser.css @@ -26,14 +26,7 @@ -fx-border-radius: 1px; } -.bookmark-list .button { --fx-border-width: 0; --fx-border-radius: 0; --fx-background-radius: 0; --fx-background-insets: 0; -} - -.bookmark-list .button:hover { +.bookmark-list .tree-cell:hover { -fx-background-color: -color-accent-muted; } @@ -41,11 +34,11 @@ -fx-background-color: -color-success-muted; } -.bookmark-list .button:drag-over { +.bookmark-list .tree-cell:drag-over { -fx-background-color: -color-success-muted; } -.bookmark-list > *:disabled { +.bookmark-list .tree-cell:disabled { -fx-opacity: 0.5; } diff --git a/app/src/main/resources/io/xpipe/app/resources/style/error-handler-comp.css b/app/src/main/resources/io/xpipe/app/resources/style/error-handler-comp.css index cf84548e5..eeb7eab5b 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/error-handler-comp.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/error-handler-comp.css @@ -3,7 +3,11 @@ -fx-spacing: 1em; } -.error-handler-comp .text-field { +.error-handler-comp .text-area * { +-fx-padding: 0; +} + +.error-handler-comp .text-area { -fx-padding: 0; -fx-border-width: 0; -fx-border-radius: 0; diff --git a/core/src/main/java/io/xpipe/core/process/CommandControl.java b/core/src/main/java/io/xpipe/core/process/CommandControl.java index e121d9b16..9b95f2d8b 100644 --- a/core/src/main/java/io/xpipe/core/process/CommandControl.java +++ b/core/src/main/java/io/xpipe/core/process/CommandControl.java @@ -80,6 +80,8 @@ public interface CommandControl extends ProcessControl { void accumulateStderr(Consumer con); + public byte[] readRawBytesOrThrow() throws Exception; + public String readOrThrow() throws Exception; public default boolean discardAndCheckExit() throws ProcessOutputException { diff --git a/core/src/main/java/io/xpipe/core/process/ShellControl.java b/core/src/main/java/io/xpipe/core/process/ShellControl.java index 091ec9514..995c049d4 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellControl.java +++ b/core/src/main/java/io/xpipe/core/process/ShellControl.java @@ -48,6 +48,12 @@ public interface ShellControl extends ProcessControl { """, script)); } + default byte[] executeSimpleRawBytesCommand(String command) throws Exception { + try (CommandControl c = command(command).start()) { + return c.readRawBytesOrThrow(); + } + } + default String executeSimpleStringCommand(String command) throws Exception { try (CommandControl c = command(command).start()) { return c.readOrThrow();