Various fixes [stage]

This commit is contained in:
crschnick 2024-08-21 13:04:55 +00:00
parent c9a07dd061
commit ae2a2d10eb
7 changed files with 42 additions and 14 deletions

View file

@ -52,7 +52,7 @@ dependencies {
api files("$rootDir/gradle/gradle_scripts/vernacular-1.16.jar") api files("$rootDir/gradle/gradle_scripts/vernacular-1.16.jar")
api 'org.bouncycastle:bcprov-jdk18on:1.78.1' api 'org.bouncycastle:bcprov-jdk18on:1.78.1'
api 'info.picocli:picocli:4.7.6' api 'info.picocli:picocli:4.7.6'
api ('org.kohsuke:github-api:1.323') { api ('org.kohsuke:github-api:1.324') {
exclude group: 'org.apache.commons', module: 'commons-lang3' exclude group: 'org.apache.commons', module: 'commons-lang3'
} }
api 'org.apache.commons:commons-lang3:3.16.0' api 'org.apache.commons:commons-lang3:3.16.0'

View file

@ -79,7 +79,7 @@ public class BrowserQuickAccessContextMenu extends ContextMenu {
getItems().addAll(r.getItems()); getItems().addAll(r.getItems());
// Prevent NPE in show() // Prevent NPE in show()
if (getScene() == null || anchor == null) { if (getScene() == null || anchor == null || anchor.getScene() == null) {
return; return;
} }
show(anchor, Side.RIGHT, 0, 0); show(anchor, Side.RIGHT, 0, 0);

View file

@ -3,8 +3,11 @@ package io.xpipe.app.comp.base;
import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.Comp;
import io.xpipe.app.fxcomps.SimpleComp; import io.xpipe.app.fxcomps.SimpleComp;
import io.xpipe.app.fxcomps.util.PlatformThread; import io.xpipe.app.fxcomps.util.PlatformThread;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.MapChangeListener;
import javafx.collections.ObservableMap;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
@ -20,22 +23,49 @@ public class MultiContentComp extends SimpleComp {
@Override @Override
protected Region createSimple() { protected Region createSimple() {
ObservableMap<Comp<?>, Region> m = FXCollections.observableHashMap();
var stack = new StackPane(); var stack = new StackPane();
m.addListener((MapChangeListener<? super Comp<?>, Region>) change -> {
if (change.wasAdded()) {
stack.getChildren().add(change.getValueAdded());
} else {
stack.getChildren().remove(change.getValueRemoved());
}
});
for (Map.Entry<Comp<?>, ObservableValue<Boolean>> e : content.entrySet()) { for (Map.Entry<Comp<?>, ObservableValue<Boolean>> e : content.entrySet()) {
var r = e.getKey().createRegion(); var r = e.getKey().createRegion();
e.getValue().subscribe(val -> { e.getValue().subscribe(val -> {
PlatformThread.runLaterIfNeeded(() -> { PlatformThread.runLaterIfNeeded(() -> {
r.setManaged(val); r.setManaged(val);
r.setVisible(val); r.setVisible(val);
if (val && !stack.getChildren().contains(r)) {
stack.getChildren().add(r);
} else {
stack.getChildren().remove(r);
}
}); });
}); });
m.put(e.getKey(), r);
} }
return stack; return stack;
} }
// Lazy impl
// @Override
// protected Region createSimple() {
// var stack = new StackPane();
// for (Map.Entry<Comp<?>, ObservableValue<Boolean>> e : content.entrySet()) {
// var r = e.getKey().createRegion();
// e.getValue().subscribe(val -> {
// PlatformThread.runLaterIfNeeded(() -> {
// r.setManaged(val);
// r.setVisible(val);
// if (val && !stack.getChildren().contains(r)) {
// stack.getChildren().add(r);
// } else {
// stack.getChildren().remove(r);
// }
// });
// });
// }
//
// return stack;
// }
} }

View file

@ -46,7 +46,7 @@ public class NativeMacOsWindowControl {
try { try {
lib.get().setAppearance(new NativeLong(nsWindow), seamlessFrame, darkMode); lib.get().setAppearance(new NativeLong(nsWindow), seamlessFrame, darkMode);
if (seamlessFrame) { if (seamlessFrame) {
ThreadHelper.sleep(100); ThreadHelper.sleep(250);
} }
} catch (Throwable e) { } catch (Throwable e) {
ErrorEvent.fromThrowable(e).handle(); ErrorEvent.fromThrowable(e).handle();

View file

@ -6,10 +6,7 @@ import io.xpipe.app.core.AppProperties;
import io.xpipe.app.core.mode.OperationMode; import io.xpipe.app.core.mode.OperationMode;
import io.xpipe.app.core.window.AppWindowHelper; import io.xpipe.app.core.window.AppWindowHelper;
import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.util.DesktopHelper; import io.xpipe.app.util.*;
import io.xpipe.app.util.DesktopShortcuts;
import io.xpipe.app.util.OptionsBuilder;
import io.xpipe.app.util.ThreadHelper;
import io.xpipe.core.process.OsType; import io.xpipe.core.process.OsType;
import io.xpipe.core.util.XPipeInstallation; import io.xpipe.core.util.XPipeInstallation;
@ -24,6 +21,7 @@ import java.nio.file.Files;
public class WorkspaceCreationAlert { public class WorkspaceCreationAlert {
public static void showAsync() { public static void showAsync() {
LicenseProvider.get().getFeature("workspaces").throwIfUnsupported();
ThreadHelper.runFailableAsync(() -> { ThreadHelper.runFailableAsync(() -> {
show(); show();
}); });

View file

@ -1,4 +1,4 @@
name=Java API for GitHub name=Java API for GitHub
version=1.321 version=1.324
license=MIT License license=MIT License
link=https://github.com/hub4j/github-api link=https://github.com/hub4j/github-api

View file

@ -1 +1 @@
11.0-14 11.0-15