Compare commits

...

2 Commits

Author SHA1 Message Date
Karl Tauber
45e7022deb Fonts: updated JetBrains Mono to v2.304 2023-01-19 00:06:00 +01:00
Karl Tauber
32dce16363 Styling: fixed resolving of UI variables in styles that use other variables 2023-01-18 23:26:34 +01:00
9 changed files with 27 additions and 7 deletions

View File

@@ -5,8 +5,11 @@ FlatLaf Change Log
#### New features and improvements
- Fonts: Added **Roboto
Mono** (https://fonts.google.com/specimen/Roboto+Mono). (PR #639, issue #638)
- Fonts:
- Added **Roboto Mono** (https://fonts.google.com/specimen/Roboto+Mono). (PR
#639, issue #638)
- Updated **JetBrains Mono** to
[v2.304](https://github.com/JetBrains/JetBrainsMono/releases/tag/v2.304).
#### Fixed bugs
@@ -20,6 +23,7 @@ FlatLaf Change Log
#628)
- Avoid that accent color affect some colors in some IntelliJ themes. (issue
#625)
- Styling: Fixed resolving of UI variables in styles that use other variables.
## 3.0

View File

@@ -334,7 +334,7 @@ class UIDefaultsLoader
if( newValue == null )
throw new IllegalArgumentException( "variable '" + value + "' not found" );
return newValue;
return resolveValueFromUIManager( newValue );
}
if( !value.startsWith( PROPERTY_PREFIX ) )

View File

@@ -29,6 +29,7 @@ import javax.swing.table.JTableHeader;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.icons.*;
import com.formdev.flatlaf.util.ColorFunctions;
@@ -39,12 +40,20 @@ public class TestFlatStyling
{
@BeforeAll
static void setup() {
HashMap<String, String> globalExtraDefaults = new HashMap<>();
globalExtraDefaults.put( "@var1", "#f00" );
globalExtraDefaults.put( "@var2", "@var1" );
globalExtraDefaults.put( "var2Resolved", "@var2" );
FlatLaf.setGlobalExtraDefaults( globalExtraDefaults );
TestUtils.setup( false );
}
@AfterAll
static void cleanup() {
TestUtils.cleanup();
FlatLaf.setGlobalExtraDefaults( null );
}
@Test
@@ -171,6 +180,13 @@ public class TestFlatStyling
"saturate(darken(@background,20%),10%)" );
}
@Test
void parseRecursiveVariables() {
Color background = UIManager.getColor( "var2Resolved" );
testColorStyle( background.getRGB(), "@var2" );
}
private void testColorStyle( int expectedRGB, String style ) {
testStyle( "background", new Color( expectedRGB, (expectedRGB & 0xff000000) != 0 ), style );
}

View File

@@ -18,7 +18,7 @@
// For maven compatibility, <font-version> should be in format <major>.<minor>[.<micro>].
// <build-number> is optional and should be incremented only if a new release is
// necessary, but the <font-version> has not changed.
version = "2.242"
version = "2.304"
if( !rootProject.hasProperty( "release" ) )
version = version.toString() + "-SNAPSHOT"

View File

@@ -1,8 +1,8 @@
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: https://scripts.sil.org/OFL
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL
-----------------------------------------------------------
@@ -18,7 +18,7 @@ with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The