mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
Linux:
- allow user scaling mode on Linux even if running in Java 9+ - update fonts (and scaling) when user changes text size or scaling in Gnome settings (#1)
This commit is contained in:
@@ -124,6 +124,11 @@ public abstract class FlatLaf
|
||||
// Windows 10 allows increasing font size independent of scaling:
|
||||
// Settings > Ease of Access > Display > Make text bigger (100% - 225%)
|
||||
desktopPropertyName = "win.messagebox.font";
|
||||
} else if( SystemInfo.IS_LINUX ) {
|
||||
// Linux/Gnome allows extra scaling and larger text:
|
||||
// Settings > Devices > Displays > Scale (100% or 200%)
|
||||
// Settings > Universal access > Large Text (off or on, 125%)
|
||||
desktopPropertyName = "gnome.Xft/DPI";
|
||||
}
|
||||
if( desktopPropertyName != null ) {
|
||||
desktopPropertyListener = e -> {
|
||||
|
||||
@@ -48,8 +48,7 @@ import javax.swing.plaf.UIResource;
|
||||
*
|
||||
* 2) user scaling mode
|
||||
*
|
||||
* This mode is for Java 8 compatibility and can be removed when changing minimum
|
||||
* required Java version to 9.
|
||||
* This mode is mainly for Java 8 compatibility, but is also used on Linux.
|
||||
* The user scale factor is computed based on the used font.
|
||||
* The JRE does not scale anything.
|
||||
* So we have to invoke {@link #scale(float)} where necessary.
|
||||
@@ -166,7 +165,7 @@ public class UIScale
|
||||
}
|
||||
|
||||
private static boolean isUserScalingEnabled() {
|
||||
if( isSystemScalingEnabled() )
|
||||
if( isSystemScalingEnabled() && !SystemInfo.IS_LINUX )
|
||||
return false; // disable user scaling if JRE scales
|
||||
|
||||
// same as in IntelliJ IDEA
|
||||
|
||||
Reference in New Issue
Block a user