mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
added system property flatlaf.useNativeLibrary to allow disabling loading of FlatLaf native library (issue #674)
This commit is contained in:
@@ -3,6 +3,11 @@ FlatLaf Change Log
|
||||
|
||||
## 3.2-SNAPSHOT
|
||||
|
||||
#### New features and improvements
|
||||
|
||||
- Added system property `flatlaf.useNativeLibrary` to allow disabling loading of
|
||||
FlatLaf native library. (issue #674)
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Styling: Fixed scaling of some styling properties (`rowHeight` for Table and
|
||||
|
||||
@@ -150,10 +150,24 @@ public interface FlatSystemProperties
|
||||
* <p>
|
||||
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
|
||||
* <strong>Default</strong> {@code true}
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
String UPDATE_UI_ON_SYSTEM_FONT_CHANGE = "flatlaf.updateUIOnSystemFontChange";
|
||||
|
||||
/**
|
||||
* Specifies whether FlatLaf native library should be used.
|
||||
* <p>
|
||||
* Setting this to {@code false} disables loading native library,
|
||||
* which also disables some features that depend on the native library.
|
||||
* <p>
|
||||
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
|
||||
* <strong>Default</strong> {@code true}
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
String USE_NATIVE_LIBRARY = "flatlaf.useNativeLibrary";
|
||||
|
||||
/**
|
||||
* Specifies a directory in which the native FlatLaf libraries have been extracted.
|
||||
* The path can be absolute or relative to current application working directory.
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
*/
|
||||
class FlatNativeLibrary
|
||||
{
|
||||
private static boolean initialized;
|
||||
private static NativeLibrary nativeLibrary;
|
||||
|
||||
/**
|
||||
@@ -45,7 +46,11 @@ class FlatNativeLibrary
|
||||
}
|
||||
|
||||
private static void initialize() {
|
||||
if( nativeLibrary != null )
|
||||
if( initialized )
|
||||
return;
|
||||
initialized = true;
|
||||
|
||||
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.USE_NATIVE_LIBRARY, true ) )
|
||||
return;
|
||||
|
||||
String classifier;
|
||||
|
||||
Reference in New Issue
Block a user