mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-28 11:25:37 +00:00
Rework
This commit is contained in:
@@ -16,6 +16,7 @@ import javafx.util.StringConverter;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -69,13 +70,15 @@ public class ChoicePaneComp extends RegionBuilder<VBox> {
|
||||
});
|
||||
|
||||
cb.prefWidthProperty().bind(vbox.widthProperty());
|
||||
|
||||
var regionMap = new HashMap<Entry, Region>();
|
||||
cb.valueProperty().subscribe(n -> {
|
||||
if (n == null) {
|
||||
if (vbox.getChildren().size() > 1) {
|
||||
vbox.getChildren().remove(1);
|
||||
}
|
||||
} else {
|
||||
var region = n.comp().build();
|
||||
var region = regionMap.computeIfAbsent(n, entry -> entry.comp().build());
|
||||
if (vbox.getChildren().size() == 1) {
|
||||
vbox.getChildren().add(region);
|
||||
} else {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ClipboardHelper {
|
||||
return;
|
||||
}
|
||||
|
||||
PlatformThread.runLaterIfNeeded(() -> {
|
||||
PlatformThread.runLaterIfNeededBlocking(() -> {
|
||||
Clipboard clipboard = Clipboard.getSystemClipboard();
|
||||
var text = clipboard.getString();
|
||||
|
||||
@@ -83,13 +83,13 @@ public class ClipboardHelper {
|
||||
}
|
||||
|
||||
public static void copyText(String s) {
|
||||
PlatformThread.runLaterIfNeeded(() -> {
|
||||
PlatformThread.runLaterIfNeededBlocking(() -> {
|
||||
apply(Map.of(DataFormat.PLAIN_TEXT, s), true);
|
||||
});
|
||||
}
|
||||
|
||||
public static void copyUrl(String s) {
|
||||
PlatformThread.runLaterIfNeeded(() -> {
|
||||
PlatformThread.runLaterIfNeededBlocking(() -> {
|
||||
apply(Map.of(DataFormat.URL, s, DataFormat.PLAIN_TEXT, s), true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -134,8 +134,8 @@ public interface ExternalApplicationType extends PrefsValue {
|
||||
var app = FlatpakCache.getApp(getFlatpakId());
|
||||
if (app.isEmpty()) {
|
||||
throw ErrorEventFactory.expected(new IOException(
|
||||
"Executable " + getExecutable() + " not found in PATH nor as a flatkpak " + getFlatpakId()
|
||||
+ " not installed. Install it and refresh the environment by restarting XPipe"));
|
||||
"Executable " + getExecutable() + " not found in PATH and flatpak package " + getFlatpakId()
|
||||
+ " not installed."));
|
||||
}
|
||||
|
||||
return FlatpakCache.getRunCommand(getFlatpakId());
|
||||
|
||||
@@ -57,7 +57,7 @@ public class RemoteDesktopDockView implements WindowDockListener {
|
||||
}
|
||||
|
||||
public synchronized void select(RemoteDesktopDockEntry p) {
|
||||
if (!entries.contains(p)) {
|
||||
if (p != null && !entries.contains(p)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ public class RemoteDesktopWindow {
|
||||
PlatformThread.runLaterIfNeededBlocking(() -> {
|
||||
if (stage != null && stage.isShowing()) {
|
||||
stage.setIconified(false);
|
||||
stage.requestFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user