mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-28 23:31:43 +12:00
Properly define webview user data directory
This commit is contained in:
parent
09146d1241
commit
8e1665ba27
2 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package io.xpipe.app.comp.base;
|
package io.xpipe.app.comp.base;
|
||||||
|
|
||||||
|
import io.xpipe.app.core.AppProperties;
|
||||||
import io.xpipe.app.core.AppResources;
|
import io.xpipe.app.core.AppResources;
|
||||||
import io.xpipe.app.fxcomps.Comp;
|
import io.xpipe.app.fxcomps.Comp;
|
||||||
import io.xpipe.app.fxcomps.CompStructure;
|
import io.xpipe.app.fxcomps.CompStructure;
|
||||||
|
@ -47,6 +48,7 @@ public class MarkdownComp extends Comp<CompStructure<StackPane>> {
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
private WebView createWebView() {
|
private WebView createWebView() {
|
||||||
var wv = new WebView();
|
var wv = new WebView();
|
||||||
|
wv.getEngine().setUserDataDirectory(AppProperties.get().getDataDir().resolve("webview").toFile());
|
||||||
wv.setPageFill(Color.TRANSPARENT);
|
wv.setPageFill(Color.TRANSPARENT);
|
||||||
var theme = AppPrefs.get() != null && AppPrefs.get().theme.getValue().isDark() ? "web/github-markdown-dark.css" : "web/github-markdown-light.css";
|
var theme = AppPrefs.get() != null && AppPrefs.get().theme.getValue().isDark() ? "web/github-markdown-dark.css" : "web/github-markdown-light.css";
|
||||||
var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, theme)
|
var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, theme)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.xpipe.app.fxcomps.impl;
|
package io.xpipe.app.fxcomps.impl;
|
||||||
|
|
||||||
|
import io.xpipe.app.core.AppProperties;
|
||||||
import io.xpipe.app.fxcomps.CompStructure;
|
import io.xpipe.app.fxcomps.CompStructure;
|
||||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||||
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
|
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
|
||||||
|
@ -54,6 +55,7 @@ public class SvgView {
|
||||||
|
|
||||||
private WebView createWebView() {
|
private WebView createWebView() {
|
||||||
var wv = new WebView();
|
var wv = new WebView();
|
||||||
|
wv.getEngine().setUserDataDirectory(AppProperties.get().getDataDir().resolve("webview").toFile());
|
||||||
// Sometimes a web view might not render when the background is set to transparent, at least according to stack
|
// Sometimes a web view might not render when the background is set to transparent, at least according to stack
|
||||||
// overflow
|
// overflow
|
||||||
wv.setPageFill(Color.valueOf("#00000001"));
|
wv.setPageFill(Color.valueOf("#00000001"));
|
||||||
|
|
Loading…
Reference in a new issue