Experiment with custom TitledBorder.border

This commit is contained in:
Reinhard Pointner 2018-02-26 10:35:42 +07:00
parent f9f8c5efef
commit 7a5a0832fc
2 changed files with 11 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import net.filebot.cli.ArgumentBean;
import net.filebot.cli.ArgumentProcessor; import net.filebot.cli.ArgumentProcessor;
import net.filebot.format.ExpressionFormat; import net.filebot.format.ExpressionFormat;
import net.filebot.platform.mac.MacAppUtilities; import net.filebot.platform.mac.MacAppUtilities;
import net.filebot.platform.windows.WinAppUtilities;
import net.filebot.ui.FileBotMenuBar; import net.filebot.ui.FileBotMenuBar;
import net.filebot.ui.GettingStartedStage; import net.filebot.ui.GettingStartedStage;
import net.filebot.ui.MainFrame; import net.filebot.ui.MainFrame;
@ -205,6 +206,7 @@ public class Main {
frame.setIconImages(ResourceManager.getApplicationIcons()); frame.setIconImages(ResourceManager.getApplicationIcons());
} else if (isWindowsApp()) { } else if (isWindowsApp()) {
// Windows specific configuration // Windows specific configuration
WinAppUtilities.initializeApplication();
frame.setIconImages(ResourceManager.getApplicationIcons()); frame.setIconImages(ResourceManager.getApplicationIcons());
} else { } else {
// generic Linux/FreeBSD/Solaris configuration // generic Linux/FreeBSD/Solaris configuration

View File

@ -1,9 +1,13 @@
package net.filebot.platform.windows; package net.filebot.platform.windows;
import static javax.swing.BorderFactory.*;
import static net.filebot.Logging.*; import static net.filebot.Logging.*;
import java.awt.Color;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.UIManager;
import com.sun.jna.WString; import com.sun.jna.WString;
import com.sun.jna.platform.win32.Shell32; import com.sun.jna.platform.win32.Shell32;
import com.sun.jna.platform.win32.WinError; import com.sun.jna.platform.win32.WinError;
@ -31,6 +35,11 @@ public class WinAppUtilities {
return null; 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() { private WinAppUtilities() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }