Compare commits

...

7 Commits

6 changed files with 81 additions and 24 deletions

View File

@@ -72,14 +72,36 @@ jobs:
# tar.exe: Couldn't open ~/.gradle/caches/modules-2/modules-2.lock: Permission denied
run: ./gradlew build-natives --no-daemon
- name: Sign Windows DLLs
if: matrix.os == 'windows-latest'
uses: skymatic/code-sign-action@v3
- name: Upload unsigned Windows DLLs for signing by SignPath.org
if: matrix.os == 'windows-latest' && github.repository == 'JFormDesigner/FlatLaf'
id: windows-unsigned
uses: actions/upload-artifact@v4
with:
certificate: '${{ secrets.CODE_SIGN_CERT_BASE64 }}'
password: '${{ secrets.CODE_SIGN_CERT_PASSWORD }}'
certificatesha1: '${{ secrets.CODE_SIGN_CERT_SHA1 }}'
folder: 'flatlaf-core/src/main/resources/com/formdev/flatlaf/natives'
name: FlatLaf-natives-windows-unsigned
path: flatlaf-natives/flatlaf-natives-windows/build/lib/main/release/**/*.dll
- name: Sign Windows DLLs using SignPath.org
if: matrix.os == 'windows-latest' && github.repository == 'JFormDesigner/FlatLaf'
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORGANIZATION_ID }}
project-slug: FlatLaf
signing-policy-slug: release-signing
artifact-configuration-slug: windows-dlls
github-artifact-id: ${{ steps.windows-unsigned.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: flatlaf-natives/flatlaf-natives-windows/build/lib/signed
- name: Copy signed Windows DLLs to flatlaf-core
if: matrix.os == 'windows-latest' && github.repository == 'JFormDesigner/FlatLaf'
shell: bash
run: |
SRC=flatlaf-natives/flatlaf-natives-windows/build/lib/signed
DEST=flatlaf-core/src/main/resources/com/formdev/flatlaf/natives
cp $SRC/aarch64/flatlaf-natives-windows.dll $DEST/flatlaf-windows-arm64.dll
cp $SRC/x86/flatlaf-natives-windows.dll $DEST/flatlaf-windows-x86.dll
cp $SRC/x86-64/flatlaf-natives-windows.dll $DEST/flatlaf-windows-x86_64.dll
- name: Sign macOS natives
if: matrix.os == 'DISABLED--macos-latest'
@@ -112,7 +134,7 @@ jobs:
# cleanup
security delete-keychain $KEYCHAIN_PATH
- name: Set artifacts pattern
- name: Set artifacts pattern for upload step
shell: bash
run: |
case ${{ matrix.os }} in

View File

@@ -7,7 +7,15 @@ FlatLaf Change Log
#1068)
- Popup: Fixed scrolling popup painting issue on Windows 10 when a glass pane is
visible and frame is maximized. (issue #1071)
- Slider: Styling `thumbSize` or `focusWidth` did not update slider size/layout.
(PR #1074)
- ToolBar: Grip disappeared when switching between Look and Feels. (issue #1075)
- Extras:
- UI defaults inspector: Fixed NPE if color of `FlatLineBorder` is null. Also
use `FlatLineBorder` line color as cell background color in "Value" column.
(PR #1080)
- `FlatDesktop`: Avoid unnecessary logging if desktop is not supported (e.g.
on NixOS with Plasma/KDE desktop).
## 3.7

View File

@@ -76,10 +76,19 @@ Otherwise, download `flatlaf-<version>.jar` here:
[![Maven Central](https://img.shields.io/maven-central/v/com.formdev/flatlaf?style=flat-square)](https://central.sonatype.com/artifact/com.formdev/flatlaf)
See also
[Native Libraries distribution](https://www.formdev.com/flatlaf/native-libraries/)
for instructions on how to redistribute FlatLaf native libraries with your
application.
- See
[Native Libraries distribution](https://www.formdev.com/flatlaf/native-libraries/)
for instructions on how to redistribute FlatLaf native libraries with your
application.
- Windows DLLs: Free code signing provided by
[SignPath.io](https://about.signpath.io/), certificate by
[SignPath Foundation](https://signpath.org/).
- If repackaging FlatLaf (and other) JARs into a single fat/uber JAR:
- add `Multi-Release: true` to `META-INF/MANIFEST.MF`
- keep `META-INF/versions/` and `META-INF/services/` directories
- merge content of equally named files in `META-INF/services/`
- If using obfuscation/minimizing/shrinking tools (e.g. **ProGuard** or
**Shadow**), exclude package `com.formdev.flatlaf` and all sub-packages.
### Snapshots

View File

@@ -227,7 +227,13 @@ public class FlatSliderUI
/** @since 2 */
protected void applyStyle( Object style ) {
Dimension oldThumbSize = thumbSize;
int oldFocusWidth = focusWidth;
oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( !thumbSize.equals( oldThumbSize ) || focusWidth != oldFocusWidth )
calculateGeometry();
}
/** @since 2 */

View File

@@ -43,7 +43,8 @@ public class FlatDesktop
public static boolean isSupported( Action action ) {
if( SystemInfo.isJava_9_orLater ) {
try {
return Desktop.getDesktop().isSupported( Enum.valueOf( Desktop.Action.class, action.name() ) );
return Desktop.isDesktopSupported() &&
Desktop.getDesktop().isSupported( Enum.valueOf( Desktop.Action.class, action.name() ) );
} catch( Exception ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
return false;

View File

@@ -777,6 +777,9 @@ public class FlatUIDefaultsInspector
@SuppressWarnings( "FormatString" ) // Error Prone
private static String color2hex( Color color ) {
if( color == null )
return "";
int rgb = color.getRGB();
boolean hasAlpha = color.getAlpha() != 255;
@@ -1018,28 +1021,36 @@ public class FlatUIDefaultsInspector
item = (Item) value;
init( table, item.key, isSelected, row );
// reset background, foreground and icon
if( !(item.value instanceof Color) ) {
// get color of value
valueColor = null;
if( item.value instanceof Color )
valueColor = (item.info instanceof Color[]) ? ((Color[])item.info)[0] : (Color) item.value;
else if( item.value instanceof FlatLineBorder )
valueColor = ((FlatLineBorder)item.value).getLineColor();
// reset background and foreground
if( valueColor == null ) {
setBackground( null );
setForeground( null );
}
if( !(item.value instanceof Icon) )
setIcon( null );
// value to string
value = item.getValueAsString();
super.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column );
if( item.value instanceof Color ) {
Color color = (item.info instanceof Color[]) ? ((Color[])item.info)[0] : (Color) item.value;
boolean isDark = new HSLColor( color ).getLuminance() < 70 && color.getAlpha() >= 128;
valueColor = color;
// set foreground, if value has color
if( valueColor != null ) {
boolean isDark = new HSLColor( valueColor ).getLuminance() < 70 && valueColor.getAlpha() >= 128;
setForeground( isDark ? Color.white : Color.black );
} else if( item.value instanceof Icon ) {
}
// set icon
if( item.value instanceof Icon ) {
Icon icon = (Icon) item.value;
setIcon( new SafeIcon( icon ) );
}
} else
setIcon( null );
// set tooltip
String toolTipText = (item.value instanceof Object[])
@@ -1056,7 +1067,7 @@ public class FlatUIDefaultsInspector
@Override
protected void paintComponent( Graphics g ) {
if( item.value instanceof Color ) {
if( valueColor != null ) {
int width = getWidth();
int height = getHeight();
Color background = valueColor;