mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
InternalFrame: title pane height was too small when iconify, maximize and close buttons are hidden (issue #132)
This commit is contained in:
@@ -5,6 +5,8 @@ FlatLaf Change Log
|
||||
|
||||
- Custom window decorations: Fixed maximized window bounds when programmatically
|
||||
maximizing window. E.g. restoring window state at startup. (issue #129)
|
||||
- InternalFrame: Title pane height was too small when iconify, maximize and close
|
||||
buttons are hidden. (issue #132)
|
||||
|
||||
|
||||
## 0.38
|
||||
|
||||
@@ -92,7 +92,21 @@ public class FlatInternalFrameTitlePane
|
||||
updateFrameIcon();
|
||||
updateColors();
|
||||
|
||||
buttonPanel = new JPanel();
|
||||
buttonPanel = new JPanel() {
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension size = super.getPreferredSize();
|
||||
int height = size.height;
|
||||
// use height of invisible buttons to always have same title pane height
|
||||
if( !iconButton.isVisible() )
|
||||
height = Math.max( height, iconButton.getPreferredSize().height );
|
||||
if( !maxButton.isVisible() )
|
||||
height = Math.max( height, maxButton.getPreferredSize().height );
|
||||
if( !closeButton.isVisible() )
|
||||
height = Math.max( height, closeButton.getPreferredSize().height );
|
||||
return new Dimension( size.width, height );
|
||||
}
|
||||
};
|
||||
buttonPanel.setLayout( new BoxLayout( buttonPanel, BoxLayout.LINE_AXIS ) );
|
||||
buttonPanel.setOpaque( false );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user