From 7a5a0832fc86616e10866c641ac9cf745d62b45a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 26 Feb 2018 10:35:42 +0700 Subject: [PATCH] Experiment with custom TitledBorder.border --- source/net/filebot/Main.java | 2 ++ source/net/filebot/platform/windows/WinAppUtilities.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index e64ea59c..476f9e50 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -36,6 +36,7 @@ import net.filebot.cli.ArgumentBean; import net.filebot.cli.ArgumentProcessor; import net.filebot.format.ExpressionFormat; import net.filebot.platform.mac.MacAppUtilities; +import net.filebot.platform.windows.WinAppUtilities; import net.filebot.ui.FileBotMenuBar; import net.filebot.ui.GettingStartedStage; import net.filebot.ui.MainFrame; @@ -205,6 +206,7 @@ public class Main { frame.setIconImages(ResourceManager.getApplicationIcons()); } else if (isWindowsApp()) { // Windows specific configuration + WinAppUtilities.initializeApplication(); frame.setIconImages(ResourceManager.getApplicationIcons()); } else { // generic Linux/FreeBSD/Solaris configuration diff --git a/source/net/filebot/platform/windows/WinAppUtilities.java b/source/net/filebot/platform/windows/WinAppUtilities.java index 819272a2..4a81220b 100644 --- a/source/net/filebot/platform/windows/WinAppUtilities.java +++ b/source/net/filebot/platform/windows/WinAppUtilities.java @@ -1,9 +1,13 @@ package net.filebot.platform.windows; +import static javax.swing.BorderFactory.*; import static net.filebot.Logging.*; +import java.awt.Color; import java.util.logging.Level; +import javax.swing.UIManager; + import com.sun.jna.WString; import com.sun.jna.platform.win32.Shell32; import com.sun.jna.platform.win32.WinError; @@ -31,6 +35,11 @@ public class WinAppUtilities { return null; } + public static void initializeApplication() { + // improved UI defaults + UIManager.put("TitledBorder.border", createCompoundBorder(createLineBorder(new Color(0xD7D7D7), 1, true), createCompoundBorder(createMatteBorder(7, 5, 6, 5, new Color(0xE5E5E5)), createEmptyBorder(0, 2, 0, 2)))); + } + private WinAppUtilities() { throw new UnsupportedOperationException(); }