added user scale factor to UI defaults to allow layout managers (e.g. MigLayout) to use it

(see https://github.com/mikaelgrev/miglayout/pull/76)
This commit is contained in:
Karl Tauber
2020-05-07 23:25:57 +02:00
parent a961001a4b
commit 7e5c599cc0

View File

@@ -321,6 +321,11 @@ public abstract class FlatLaf
for( FlatDefaultsAddon addon : addons ) for( FlatDefaultsAddon addon : addons )
addon.afterDefaultsLoading( this, defaults ); addon.afterDefaultsLoading( this, defaults );
// add user scale factor to allow layout managers (e.g. MigLayout) to use it
defaults.put( "laf.scaleFactor", (ActiveValue) t -> {
return UIScale.getUserScaleFactor();
} );
if( postInitialization != null ) { if( postInitialization != null ) {
postInitialization.accept( defaults ); postInitialization.accept( defaults );
postInitialization = null; postInitialization = null;