mirror of
https://github.com/mitb-archive/filebot
synced 2024-08-13 17:03:45 -04:00
Include and use JFX webkit in Windows builds
This commit is contained in:
parent
1495fa6e9d
commit
d03453450b
@ -84,9 +84,6 @@
|
|||||||
<patternset>
|
<patternset>
|
||||||
<exclude name="**/dtplugin/**" />
|
<exclude name="**/dtplugin/**" />
|
||||||
<exclude name="**/plugin2/**" />
|
<exclude name="**/plugin2/**" />
|
||||||
|
|
||||||
<!-- reduce MSI size by ~20 MB -->
|
|
||||||
<exclude name="**/jfxwebkit.dll" />
|
|
||||||
</patternset>
|
</patternset>
|
||||||
<cutdirsmapper dirs="1" />
|
<cutdirsmapper dirs="1" />
|
||||||
</untar>
|
</untar>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# deployment options
|
# deployment options
|
||||||
-Dapplication.dir="%APPDATA%\FileBot"
|
-Dapplication.dir="%APPDATA%\FileBot"
|
||||||
-Dapplication.deployment=appx
|
-Dapplication.deployment=appx
|
||||||
|
-Dapplication.help=show
|
||||||
-Dapplication.update=skip
|
-Dapplication.update=skip
|
||||||
|
|
||||||
# put all temporary files here
|
# put all temporary files here
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# deployment options
|
# deployment options
|
||||||
-Dapplication.dir="%APPDATA%\FileBot"
|
-Dapplication.dir="%APPDATA%\FileBot"
|
||||||
-Dapplication.deployment=appx
|
-Dapplication.deployment=appx
|
||||||
|
-Dapplication.help=show
|
||||||
-Dapplication.update=skip
|
-Dapplication.update=skip
|
||||||
|
|
||||||
# put all temporary files here
|
# put all temporary files here
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# deployment options
|
# deployment options
|
||||||
-Dapplication.dir="%APPDATA%\FileBot"
|
-Dapplication.dir="%APPDATA%\FileBot"
|
||||||
-Dapplication.deployment=msi
|
-Dapplication.deployment=msi
|
||||||
|
-Dapplication.help=show
|
||||||
|
|
||||||
# put all temporary files here
|
# put all temporary files here
|
||||||
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
|
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# deployment options
|
# deployment options
|
||||||
-Dapplication.dir="%APPDATA%\FileBot"
|
-Dapplication.dir="%APPDATA%\FileBot"
|
||||||
-Dapplication.deployment=msi
|
-Dapplication.deployment=msi
|
||||||
|
-Dapplication.help=show
|
||||||
|
|
||||||
# put all temporary files here
|
# put all temporary files here
|
||||||
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
|
-Djava.io.tmpdir="%APPDATA%\FileBot\tmp"
|
||||||
|
@ -88,17 +88,21 @@ public class GettingStartedStage {
|
|||||||
stage.setTitle(webview.getEngine().getTitle());
|
stage.setTitle(webview.getEngine().getTitle());
|
||||||
stage.toFront();
|
stage.toFront();
|
||||||
webview.requestFocus();
|
webview.requestFocus();
|
||||||
|
|
||||||
|
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(750), new KeyValue(stage.opacityProperty(), 1.0, Interpolator.EASE_IN)));
|
||||||
|
timeline.setOnFinished((evt) -> {
|
||||||
|
stage.setOpacity(1.0);
|
||||||
|
stage.requestFocus();
|
||||||
|
});
|
||||||
|
timeline.play();
|
||||||
} else if (n == Worker.State.FAILED) {
|
} else if (n == Worker.State.FAILED) {
|
||||||
stage.close();
|
stage.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
stage.setTitle("Loading …");
|
stage.setTitle("Loading ...");
|
||||||
stage.setScene(new Scene(webview, webview.getPrefWidth(), webview.getPrefHeight(), Color.BLACK));
|
stage.setScene(new Scene(webview, webview.getPrefWidth(), webview.getPrefHeight(), Color.BLACK));
|
||||||
|
|
||||||
// force black background while page is loading
|
|
||||||
setBackground(webview.getEngine(), 0xFF000000);
|
|
||||||
|
|
||||||
// make sure that we can read the user locale in JS
|
// make sure that we can read the user locale in JS
|
||||||
webview.getEngine().executeScript(String.format("navigator.locale = '%s'", Locale.getDefault()));
|
webview.getEngine().executeScript(String.format("navigator.locale = '%s'", Locale.getDefault()));
|
||||||
}
|
}
|
||||||
@ -106,28 +110,6 @@ public class GettingStartedStage {
|
|||||||
public void show() {
|
public void show() {
|
||||||
stage.setOpacity(0.0);
|
stage.setOpacity(0.0);
|
||||||
stage.show();
|
stage.show();
|
||||||
|
|
||||||
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(500), new KeyValue(stage.opacityProperty(), 1.0, Interpolator.EASE_IN)));
|
|
||||||
timeline.setOnFinished((evt) -> {
|
|
||||||
stage.setOpacity(1.0);
|
|
||||||
stage.requestFocus();
|
|
||||||
});
|
|
||||||
timeline.play();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setBackground(WebEngine engine, int color) {
|
|
||||||
/*
|
|
||||||
* Java 9 makes internal classes inaccessible, so setting the page background is no longer supported: package com.sun.webkit is declared in module javafx.web, which does not export it
|
|
||||||
*/
|
|
||||||
// try {
|
|
||||||
// // use reflection to retrieve the WebEngine's private 'page' field
|
|
||||||
// Field f = engine.getClass().getDeclaredField("page");
|
|
||||||
// f.setAccessible(true);
|
|
||||||
// com.sun.webkit.WebPage page = (com.sun.webkit.WebPage) f.get(engine);
|
|
||||||
// page.setBackgroundColor(color);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// debug.log(Level.WARNING, "Failed to set background", e);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected WebEngine onPopup(WebView webview) {
|
protected WebEngine onPopup(WebView webview) {
|
||||||
|
Loading…
Reference in New Issue
Block a user