mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
DesktopPane: fixed incomplete minimized icon when switching LaF
This commit is contained in:
@@ -16,8 +16,9 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
#### Fixed bugs
|
#### Fixed bugs
|
||||||
|
|
||||||
- DesktopPane: Fixed empty minimized icon when using a custom desktop manager.
|
- DesktopPane:
|
||||||
(PR #294)
|
- Fixed empty minimized icon when using a custom desktop manager. (PR #294)
|
||||||
|
- Fixed incomplete minimized icon when switching LaF.
|
||||||
|
|
||||||
|
|
||||||
## 1.1.2
|
## 1.1.2
|
||||||
|
|||||||
@@ -246,13 +246,22 @@ public class FlatDesktopIconUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// layout internal frame title pane, which was recreated when switching Laf
|
||||||
|
// (directly invoke doLayout() because frame.validate() does not work here
|
||||||
|
// because frame is not displayable)
|
||||||
|
if( !frame.isValid() )
|
||||||
|
frame.doLayout();
|
||||||
|
for( Component c : frame.getComponents() ) {
|
||||||
|
if( !c.isValid() )
|
||||||
|
c.doLayout();
|
||||||
|
}
|
||||||
|
|
||||||
// paint internal frame to buffered image
|
// paint internal frame to buffered image
|
||||||
int frameWidth = Math.max( frame.getWidth(), 1 );
|
int frameWidth = Math.max( frame.getWidth(), 1 );
|
||||||
int frameHeight = Math.max( frame.getHeight(), 1 );
|
int frameHeight = Math.max( frame.getHeight(), 1 );
|
||||||
BufferedImage frameImage = new BufferedImage( frameWidth, frameHeight, BufferedImage.TYPE_INT_ARGB );
|
BufferedImage frameImage = new BufferedImage( frameWidth, frameHeight, BufferedImage.TYPE_INT_ARGB );
|
||||||
Graphics2D g = frameImage.createGraphics();
|
Graphics2D g = frameImage.createGraphics();
|
||||||
try {
|
try {
|
||||||
//TODO fix missing internal frame header when switching LaF
|
|
||||||
frame.paint( g );
|
frame.paint( g );
|
||||||
} finally {
|
} finally {
|
||||||
g.dispose();
|
g.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user