mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
macos fixes
This commit is contained in:
parent
fcc47b9038
commit
2ffea800b5
3 changed files with 17 additions and 1 deletions
|
@ -95,6 +95,7 @@ public class PrettyImageComp extends SimpleComp {
|
|||
currentNode.set(node);
|
||||
} else {
|
||||
var storeIcon = new ImageView();
|
||||
storeIcon.setFocusTraversable(false);
|
||||
storeIcon
|
||||
.imageProperty()
|
||||
.bind(Bindings.createObjectBinding(
|
||||
|
@ -132,6 +133,7 @@ public class PrettyImageComp extends SimpleComp {
|
|||
|
||||
stack.getChildren().setAll(val);
|
||||
});
|
||||
stack.setFocusTraversable(false);
|
||||
stack.setPrefWidth(width);
|
||||
stack.setMinWidth(width);
|
||||
stack.setPrefHeight(height);
|
||||
|
|
|
@ -6,9 +6,11 @@ import io.xpipe.app.fxcomps.util.SimpleChangeListener;
|
|||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.css.Size;
|
||||
import javafx.css.SizeUnits;
|
||||
import javafx.geometry.Point2D;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.web.WebView;
|
||||
|
@ -17,6 +19,7 @@ import lombok.Getter;
|
|||
import lombok.SneakyThrows;
|
||||
import lombok.Value;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Getter
|
||||
|
@ -107,6 +110,15 @@ public class SvgView {
|
|||
wv.getEngine().loadContent(getHtml(n));
|
||||
});
|
||||
|
||||
// Hide scrollbars that popup on every content change. Bug in WebView?
|
||||
wv.getChildrenUnmodifiable().addListener((ListChangeListener<Node>) change -> {
|
||||
Set<Node> scrolls = wv.lookupAll(".scroll-bar");
|
||||
for (Node scroll : scrolls) {
|
||||
scroll.setVisible(false);
|
||||
scroll.setFocusTraversable(false);
|
||||
}
|
||||
});
|
||||
|
||||
// As the aspect ratio of the WebView is kept constant, we can compute the zoom only using the width
|
||||
wv.zoomProperty()
|
||||
.bind(Bindings.createDoubleBinding(
|
||||
|
|
|
@ -96,12 +96,13 @@ public class ScanAlert {
|
|||
btOk.addEventFilter(ActionEvent.ACTION, event -> {
|
||||
BusyProperty.execute(busy, () -> {
|
||||
for (var a : selected) {
|
||||
try (var ignored = new BusyProperty(busy)) {
|
||||
try {
|
||||
a.getScanner().run();
|
||||
} catch (Exception ex) {
|
||||
ErrorEvent.fromThrowable(ex).handle();
|
||||
}
|
||||
}
|
||||
alert.setResult(ButtonType.OK);
|
||||
alert.close();
|
||||
});
|
||||
});
|
||||
|
@ -114,6 +115,7 @@ public class ScanAlert {
|
|||
|
||||
Platform.runLater(() -> {
|
||||
if (a == null) {
|
||||
alert.setResult(ButtonType.OK);
|
||||
alert.close();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue