Port fixes from kickstartfx

This commit is contained in:
crschnick
2026-04-08 08:05:33 +00:00
parent 0ff033617e
commit 9017aed9d0
2 changed files with 16 additions and 8 deletions
@@ -25,6 +25,7 @@ import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.function.UnaryOperator;
@@ -92,13 +93,20 @@ public class MarkdownComp extends RegionBuilder<StackPane> {
wv.setPageFill(Color.TRANSPARENT);
wv.getEngine()
.setUserDataDirectory(AppCache.getBasePath().resolve("webview").toFile());
var theme = AppPrefs.get() != null
&& AppPrefs.get().theme().getValue() != null
&& AppPrefs.get().theme().getValue().isDark()
? "misc/github-markdown-dark.css"
: "misc/github-markdown-light.css";
var url = AppResources.getResourceURL(AppResources.MAIN_MODULE, theme).orElseThrow();
wv.getEngine().setUserStyleSheetLocation(url.toString());
if (AppPrefs.get() != null) {
var ref = new WeakReference<>(wv);
AppPrefs.get().theme().subscribe((v) -> {
var refVal = ref.get();
if (refVal != null && v != null) {
var theme = v.isDark()
? "misc/github-markdown-dark.css"
: "misc/github-markdown-light.css";
var url = AppResources.getResourceURL(AppResources.MAIN_MODULE, theme).orElseThrow();
refVal.getEngine().setUserStyleSheetLocation(url.toString());
}
});
}
markdown.subscribe(val -> {
PlatformThread.runLaterIfNeeded(() -> {
+1 -1
View File
@@ -182,7 +182,7 @@ def getJvmArgs() {
jvmRunArgs += ["-Dprism.order=mtl,es2,sw"]
}
// Use new metal pipeline on macOS
// Fix uncontrolled animation framerate issues on Linux, see https://bugs.openjdk.org/browse/JDK-8210547
if (os.isLinux()) {
jvmRunArgs += ["-Dquantum.multithreaded=false"]
}