disable MigLayout scaling to fix layout on high-resolution screens

This commit is contained in:
Reinhard Pointner 2018-03-05 18:57:51 +07:00
parent 53429d9073
commit a459d40961
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,8 @@ import com.sun.jna.platform.win32.Shell32;
import com.sun.jna.platform.win32.WinError; import com.sun.jna.platform.win32.WinError;
import com.sun.jna.ptr.PointerByReference; import com.sun.jna.ptr.PointerByReference;
import net.miginfocom.layout.PlatformDefaults;
public class WinAppUtilities { public class WinAppUtilities {
public static void setAppUserModelID(String appID) { public static void setAppUserModelID(String appID) {
@ -38,6 +40,9 @@ public class WinAppUtilities {
public static void initializeApplication() { public static void initializeApplication() {
// improved UI defaults // improved UI defaults
UIManager.put("TitledBorder.border", createCompoundBorder(createLineBorder(new Color(0xD7D7D7), 1, true), createCompoundBorder(createMatteBorder(6, 5, 6, 5, new Color(0xE5E5E5)), createEmptyBorder(0, 2, 0, 2)))); UIManager.put("TitledBorder.border", createCompoundBorder(createLineBorder(new Color(0xD7D7D7), 1, true), createCompoundBorder(createMatteBorder(6, 5, 6, 5, new Color(0xE5E5E5)), createEmptyBorder(0, 2, 0, 2))));
// disable MigLayout auto-scaling (see https://github.com/mikaelgrev/miglayout/issues/53)
PlatformDefaults.setLogicalPixelBase(PlatformDefaults.BASE_REAL_PIXEL);
} }
private WinAppUtilities() { private WinAppUtilities() {