mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-27 03:46:17 -06:00
Extras: FlatSVGUtils.createWindowIconImages(): return multi-resolution image only on Windows because Java implementations for macOS and Linux do not support multi-resolution images for window title icons
(issue #323)
This commit is contained in:
@@ -34,7 +34,7 @@ FlatLaf Change Log
|
||||
and prettified class names (dimmed package name).
|
||||
- Extras: `FlatSVGUtils.createWindowIconImages()` now returns a single
|
||||
multi-resolution image that creates requested image sizes on demand from SVG
|
||||
(Java 9+).
|
||||
(only on Windows with Java 9+).
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.swing.JWindow;
|
||||
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.kitfox.svg.SVGCache;
|
||||
import com.kitfox.svg.SVGDiagram;
|
||||
import com.kitfox.svg.SVGException;
|
||||
@@ -44,7 +45,7 @@ public class FlatSVGUtils
|
||||
* can be used for windows headers. The SVG should have a size of 16x16,
|
||||
* otherwise it is scaled.
|
||||
* <p>
|
||||
* If running on Java 9 or later and multi-resolution image support is available,
|
||||
* If running on Windows in Java 9 or later and multi-resolution image support is available,
|
||||
* then a single multi-resolution image is returned that creates images on demand
|
||||
* for requested sizes from SVG.
|
||||
* This has the advantage that only images for used sizes are created.
|
||||
@@ -58,7 +59,7 @@ public class FlatSVGUtils
|
||||
public static List<Image> createWindowIconImages( String svgName ) {
|
||||
SVGDiagram diagram = loadSVG( svgName );
|
||||
|
||||
if( MultiResolutionImageSupport.isAvailable() ) {
|
||||
if( SystemInfo.isWindows && MultiResolutionImageSupport.isAvailable() ) {
|
||||
// use a multi-resolution image that creates images on demand for requested sizes
|
||||
return Collections.singletonList( MultiResolutionImageSupport.create( 0,
|
||||
new Dimension[] {
|
||||
|
||||
Reference in New Issue
Block a user