From bc18cc6489eb9512f93f62de44edee24dea1dd12 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 10 May 2015 21:28:59 +0000 Subject: [PATCH] * add window icons --- source/net/filebot/ResourceManager.java | 8 ++++++++ source/net/filebot/ui/GettingStartedStage.java | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/ResourceManager.java b/source/net/filebot/ResourceManager.java index 41fced35..03ea5a75 100644 --- a/source/net/filebot/ResourceManager.java +++ b/source/net/filebot/ResourceManager.java @@ -34,6 +34,14 @@ public final class ResourceManager { return asList(images); } + public static List getApplicationIconURLs() { + URL[] images = new URL[3]; + images[0] = ResourceManager.getImageResource("window.icon.small"); + images[1] = ResourceManager.getImageResource("window.icon.medium"); + images[2] = ResourceManager.getImageResource("window.icon.large"); + return asList(images); + } + public static Icon getFlagIcon(String languageCode) { return getIcon(String.format("flags/%s", languageCode)); } diff --git a/source/net/filebot/ui/GettingStartedStage.java b/source/net/filebot/ui/GettingStartedStage.java index 4eb164b6..2151cce6 100644 --- a/source/net/filebot/ui/GettingStartedStage.java +++ b/source/net/filebot/ui/GettingStartedStage.java @@ -6,16 +6,20 @@ import java.awt.Desktop; import java.net.URI; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.stream.Collectors; import javafx.application.Platform; import javafx.concurrent.Worker.State; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.scene.paint.Color; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; +import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.StageStyle; import net.filebot.Main; +import net.filebot.ResourceManager; import net.filebot.Settings; public class GettingStartedStage { @@ -27,16 +31,20 @@ public class GettingStartedStage { Platform.runLater(() -> { Stage stage = new Stage(); - stage.setResizable(false); if (isMacApp()) { // Mac OS X specific configuration stage.initStyle(StageStyle.DECORATED); + stage.initModality(Modality.NONE); } else { // Windows / Linux specific configuration stage.initStyle(StageStyle.UTILITY); + stage.initModality(Modality.NONE); } + stage.getIcons().addAll(ResourceManager.getApplicationIconURLs().stream().map((url) -> new Image(url.toString())).collect(Collectors.toList())); + stage.setResizable(false); + GettingStartedStage view = new GettingStartedStage(stage); view.show(); });