From c28c4138da80b43feeedd7abc4baafb1bcc8c117 Mon Sep 17 00:00:00 2001 From: Bradley Turek Date: Sat, 13 Apr 2019 23:29:10 -0600 Subject: [PATCH] This is related to PR #158 in edvin/fxlauncher (https://github.com/edvin/fxlauncher/pull/158). It allows you to customize the UI. The fields to customize the UI were already apart of FXLauncher, there was just no easy way to change them. The fields are * updateText (--update-text) * updateLabelStyle (--update-label-style) * progressBarStyle (--progress-bar-style) * wrapperStyle (--wrapper-style) --- .../gradle/FXLauncherExtension.groovy | 29 ++++++++++++++++++- .../GenerateApplicationManifestTask.groovy | 13 +++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/no/tornado/fxlauncher/gradle/FXLauncherExtension.groovy b/src/main/groovy/no/tornado/fxlauncher/gradle/FXLauncherExtension.groovy index 2fcb57e..d2e328f 100644 --- a/src/main/groovy/no/tornado/fxlauncher/gradle/FXLauncherExtension.groovy +++ b/src/main/groovy/no/tornado/fxlauncher/gradle/FXLauncherExtension.groovy @@ -55,6 +55,34 @@ class FXLauncherExtension { List javapackagerOptions String javapackerNativeParam = "" + /** + * The text that the launcher will show when showing the FXLauncher updating user interface. + *

+ * The default is Updating.... + */ + String updateText + + /** + * The CSS styling to apply to the {@link #updateText} Label. + *

+ * The default is -fx-font-weight: bold;. + */ + String updateLabelStyle + + /** + * The CSS styling to apply to the progress bar. + *

+ * The default is -fx-pref-width: 200;. + */ + String progressBarStyle + + /** + * The CSS styling to apply to the VBox that contains the update text and the progress bar. + *

+ * The default is -fx-spacing: 10; -fx-padding: 25;. + */ + String wrapperStyle + String cacheDir Boolean acceptDowngrade @@ -70,7 +98,6 @@ class FXLauncherExtension { final Project project - FXLauncherExtension(Project project) { this.project = project applicationVersion = project.version diff --git a/src/main/groovy/no/tornado/fxlauncher/gradle/GenerateApplicationManifestTask.groovy b/src/main/groovy/no/tornado/fxlauncher/gradle/GenerateApplicationManifestTask.groovy index 95c036b..22b7e43 100644 --- a/src/main/groovy/no/tornado/fxlauncher/gradle/GenerateApplicationManifestTask.groovy +++ b/src/main/groovy/no/tornado/fxlauncher/gradle/GenerateApplicationManifestTask.groovy @@ -37,12 +37,25 @@ class GenerateApplicationManifestTask extends DefaultTask { FXLauncherExtension fxlauncher = project.extensions.fxlauncher + // These first three arguments are required by the CreateManifest class. def args = [ fxlauncher.resolveApplicationUrl(), fxlauncher.resolveApplicationMainClass(), fxlauncher.resolveWorkingDirectory().absolutePath ] + if (fxlauncher.updateText) + args += '--update-text=' + fxlauncher.updateText + + if (fxlauncher.updateLabelStyle) + args += '--update-label-style=' + fxlauncher.updateLabelStyle + + if (fxlauncher.progressBarStyle) + args += '--progress-bar-style=' + fxlauncher.progressBarStyle + + if (fxlauncher.wrapperStyle) + args += '--wrapper-style=' + fxlauncher.wrapperStyle + if (fxlauncher.cacheDir) args += '--cache-dir=' + fxlauncher.cacheDir