mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
DesktopPane: fixed incomplete minimized icon when switching LaF
This commit is contained in:
@@ -16,8 +16,9 @@ FlatLaf Change Log
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- DesktopPane: Fixed empty minimized icon when using a custom desktop manager.
|
||||
(PR #294)
|
||||
- DesktopPane:
|
||||
- Fixed empty minimized icon when using a custom desktop manager. (PR #294)
|
||||
- Fixed incomplete minimized icon when switching LaF.
|
||||
|
||||
|
||||
## 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
|
||||
int frameWidth = Math.max( frame.getWidth(), 1 );
|
||||
int frameHeight = Math.max( frame.getHeight(), 1 );
|
||||
BufferedImage frameImage = new BufferedImage( frameWidth, frameHeight, BufferedImage.TYPE_INT_ARGB );
|
||||
Graphics2D g = frameImage.createGraphics();
|
||||
try {
|
||||
//TODO fix missing internal frame header when switching LaF
|
||||
frame.paint( g );
|
||||
} finally {
|
||||
g.dispose();
|
||||
|
||||
Reference in New Issue
Block a user