mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Theme Editor: store unscaled window bounds in preferences so that using Java 8 or 9+ results in same size on screen
This commit is contained in:
@@ -429,10 +429,10 @@ public class FlatThemeFileEditor
|
|||||||
List<String> list = StringUtils.split( windowBoundsStr, ',' );
|
List<String> list = StringUtils.split( windowBoundsStr, ',' );
|
||||||
if( list.size() >= 4 ) {
|
if( list.size() >= 4 ) {
|
||||||
try {
|
try {
|
||||||
int x = Integer.parseInt( list.get( 0 ) );
|
int x = UIScale.scale( Integer.parseInt( list.get( 0 ) ) );
|
||||||
int y = Integer.parseInt( list.get( 1 ) );
|
int y = UIScale.scale( Integer.parseInt( list.get( 1 ) ) );
|
||||||
int w = Integer.parseInt( list.get( 2 ) );
|
int w = UIScale.scale( Integer.parseInt( list.get( 2 ) ) );
|
||||||
int h = Integer.parseInt( list.get( 3 ) );
|
int h = UIScale.scale( Integer.parseInt( list.get( 3 ) ) );
|
||||||
|
|
||||||
// limit to screen size
|
// limit to screen size
|
||||||
GraphicsConfiguration gc = getGraphicsConfiguration();
|
GraphicsConfiguration gc = getGraphicsConfiguration();
|
||||||
@@ -464,7 +464,11 @@ public class FlatThemeFileEditor
|
|||||||
|
|
||||||
private void saveWindowBounds() {
|
private void saveWindowBounds() {
|
||||||
Rectangle r = getBounds();
|
Rectangle r = getBounds();
|
||||||
state.put( KEY_WINDOW_BOUNDS, r.x + "," + r.y + ',' + r.width + ',' + r.height );
|
int x = UIScale.unscale( r.x );
|
||||||
|
int y = UIScale.unscale( r.y );
|
||||||
|
int width = UIScale.unscale( r.width );
|
||||||
|
int height = UIScale.unscale( r.height );
|
||||||
|
state.put( KEY_WINDOW_BOUNDS, x + "," + y + ',' + width + ',' + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void putPrefsString( Preferences prefs, String key, String value ) {
|
private static void putPrefsString( Preferences prefs, String key, String value ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user