Skip to content

Commit

Permalink
Window decorations:
Browse files Browse the repository at this point in the history
- fixed updating of client property `FULL_WINDOW_CONTENT_BUTTONS_BOUNDS` when resizing window
- fixed title bar buttons placeholder debug painting
  • Loading branch information
DevCharly committed Feb 6, 2024
1 parent a84aceb commit b804463
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,14 @@ public Dimension getPreferredSize() {
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 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ private static void debugPaintRect( Graphics g, Rectangle r ) {
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 );
}
}

0 comments on commit b804463

Please sign in to comment.