mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
added system property flatlaf.updateUIOnSystemFontChange to allow disabling automatic UI update when system font changes (issue #580)
This commit is contained in:
@@ -10,6 +10,8 @@ FlatLaf Change Log
|
|||||||
- Native window decorations (Windows 10/11 only): Added client property to mark
|
- Native window decorations (Windows 10/11 only): Added client property to mark
|
||||||
components in embedded menu bar as "caption" (allow moving window). (issue
|
components in embedded menu bar as "caption" (allow moving window). (issue
|
||||||
#569)
|
#569)
|
||||||
|
- Added system property `flatlaf.updateUIOnSystemFontChange` to allow disabling
|
||||||
|
automatic UI update when system font changes. (issue #580)
|
||||||
|
|
||||||
#### Fixed bugs
|
#### Fixed bugs
|
||||||
|
|
||||||
|
|||||||
@@ -276,6 +276,9 @@ public abstract class FlatLaf
|
|||||||
}
|
}
|
||||||
if( desktopPropertyName != null ) {
|
if( desktopPropertyName != null ) {
|
||||||
desktopPropertyListener = e -> {
|
desktopPropertyListener = e -> {
|
||||||
|
if( !FlatSystemProperties.getBoolean( FlatSystemProperties.UPDATE_UI_ON_SYSTEM_FONT_CHANGE, true ) )
|
||||||
|
return;
|
||||||
|
|
||||||
String propertyName = e.getPropertyName();
|
String propertyName = e.getPropertyName();
|
||||||
if( desktopPropertyName.equals( propertyName ) || propertyName.equals( desktopPropertyName2 ) )
|
if( desktopPropertyName.equals( propertyName ) || propertyName.equals( desktopPropertyName2 ) )
|
||||||
reSetLookAndFeel();
|
reSetLookAndFeel();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf;
|
package com.formdev.flatlaf;
|
||||||
|
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,6 +140,20 @@ public interface FlatSystemProperties
|
|||||||
*/
|
*/
|
||||||
String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection";
|
String USE_TEXT_Y_CORRECTION = "flatlaf.useTextYCorrection";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies whether FlatLaf updates the UI when the system font changes.
|
||||||
|
* If {@code true}, {@link SwingUtilities#updateComponentTreeUI(java.awt.Component)}
|
||||||
|
* gets invoked for all windows if the system font has changed.
|
||||||
|
* This is the similar to when switching to another look and feel (theme).
|
||||||
|
* Applications that do not work correctly when switching look and feel,
|
||||||
|
* should disable this option to avoid corrupted UI.
|
||||||
|
* <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 a directory in which the native FlatLaf library have been extracted.
|
* Specifies a directory in which the native FlatLaf library have been extracted.
|
||||||
* The path can be absolute or relative to current application working directory.
|
* The path can be absolute or relative to current application working directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user