Window decorations:

- fixed updating of client property `FULL_WINDOW_CONTENT_BUTTONS_BOUNDS` when resizing window
- fixed title bar buttons placeholder debug painting
This commit is contained in:
Karl Tauber
2024-02-06 11:30:11 +01:00
parent a84aceb1ba
commit b804463b73
2 changed files with 10 additions and 5 deletions

View File

@@ -359,11 +359,14 @@ public class FlatTitlePane
buttonPanel.add( maximizeButton );
buttonPanel.add( restoreButton );
}
buttonPanel.addComponentListener( new ComponentAdapter() {
buttonPanel.add( closeButton );
ComponentListener l = new ComponentAdapter() {
@Override public void componentResized( ComponentEvent e ) { updateFullWindowContentButtonsBoundsProperty(); }
@Override public void componentMoved( ComponentEvent e ) { updateFullWindowContentButtonsBoundsProperty(); }
} );
buttonPanel.add( closeButton );
};
buttonPanel.addComponentListener( l );
addComponentListener( l );
}
protected JButton createButton( String iconKey, String accessibleName, ActionListener action ) {

View File

@@ -209,9 +209,11 @@ class FullWindowContentSupport
g.drawRect( r.x, r.y, r.width - 1, r.height - 1 );
// draw diagonal cross
int x2 = r.x + r.width - 1;
int y2 = r.y + r.height - 1;
Object[] oldRenderingHints = FlatUIUtils.setRenderingHints( g );
g.drawLine( r.x, r.y, r.width - 1, r.height - 1 );
g.drawLine( r.x, r.height - 1, r.width - 1, r.y );
g.drawLine( r.x, r.y, x2, y2 );
g.drawLine( r.x, y2, x2, r.y );
FlatUIUtils.resetRenderingHints( g, oldRenderingHints );
}
}