mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -06:00
Window decorations: FlatTitlePane: fixed size of hit test spot on right side of menu bar if it contains a glue and a stretching component (e.g. progress bar)
removed HIT_TEST_SPOT_GROW because it is no longer necessary since commit 54e6cefa67
This commit is contained in:
@@ -520,8 +520,8 @@ public class FlatTitlePane
|
|||||||
}
|
}
|
||||||
paintRect( g, Color.cyan, debugCloseButtonBounds );
|
paintRect( g, Color.cyan, debugCloseButtonBounds );
|
||||||
paintRect( g, Color.blue, debugAppIconBounds );
|
paintRect( g, Color.blue, debugAppIconBounds );
|
||||||
paintRect( g, Color.magenta, debugMinimizeButtonBounds );
|
paintRect( g, Color.blue, debugMinimizeButtonBounds );
|
||||||
paintRect( g, Color.blue, debugMaximizeButtonBounds );
|
paintRect( g, Color.magenta, debugMaximizeButtonBounds );
|
||||||
paintRect( g, Color.cyan, debugCloseButtonBounds );
|
paintRect( g, Color.cyan, debugCloseButtonBounds );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,7 +766,7 @@ debug*/
|
|||||||
|
|
||||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||||
if( hasVisibleEmbeddedMenuBar( menuBar ) ) {
|
if( hasVisibleEmbeddedMenuBar( menuBar ) ) {
|
||||||
r = getNativeHitTestSpot( menuBarPlaceholder );
|
r = getNativeHitTestSpot( menuBar );
|
||||||
if( r != null ) {
|
if( r != null ) {
|
||||||
Component horizontalGlue = findHorizontalGlue( menuBar );
|
Component horizontalGlue = findHorizontalGlue( menuBar );
|
||||||
if( horizontalGlue != null ) {
|
if( horizontalGlue != null ) {
|
||||||
@@ -775,18 +775,18 @@ debug*/
|
|||||||
// the glue component area can used to move the window.
|
// the glue component area can used to move the window.
|
||||||
|
|
||||||
Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, window );
|
Point glueLocation = SwingUtilities.convertPoint( horizontalGlue, 0, 0, window );
|
||||||
|
int x2 = glueLocation.x + horizontalGlue.getWidth();
|
||||||
Rectangle r2;
|
Rectangle r2;
|
||||||
if( getComponentOrientation().isLeftToRight() ) {
|
if( getComponentOrientation().isLeftToRight() ) {
|
||||||
int trailingWidth = (r.x + r.width - HIT_TEST_SPOT_GROW) - glueLocation.x;
|
r2 = new Rectangle( x2, r.y, (r.x + r.width) - x2, r.height );
|
||||||
r.width -= trailingWidth;
|
|
||||||
r2 = new Rectangle( glueLocation.x + horizontalGlue.getWidth(), r.y, trailingWidth, r.height );
|
r.width = glueLocation.x - r.x;
|
||||||
} else {
|
} else {
|
||||||
int leadingWidth = (glueLocation.x + horizontalGlue.getWidth()) - (r.x + HIT_TEST_SPOT_GROW);
|
r2 = new Rectangle( r.x, r.y, glueLocation.x - r.x, r.height );
|
||||||
r.x += leadingWidth;
|
|
||||||
r.width -= leadingWidth;
|
r.width = (r.x + r.width) - x2;
|
||||||
r2 = new Rectangle( glueLocation.x -leadingWidth, r.y, leadingWidth, r.height );
|
r.x = x2;
|
||||||
}
|
}
|
||||||
r2.grow( HIT_TEST_SPOT_GROW, HIT_TEST_SPOT_GROW );
|
|
||||||
hitTestSpots.add( r2 );
|
hitTestSpots.add( r2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,13 +825,9 @@ debug*/
|
|||||||
|
|
||||||
Point location = SwingUtilities.convertPoint( c, 0, 0, window );
|
Point location = SwingUtilities.convertPoint( c, 0, 0, window );
|
||||||
Rectangle r = new Rectangle( location, size );
|
Rectangle r = new Rectangle( location, size );
|
||||||
// slightly increase rectangle so that component receives mouseExit events
|
|
||||||
r.grow( HIT_TEST_SPOT_GROW, HIT_TEST_SPOT_GROW );
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int HIT_TEST_SPOT_GROW = 2;
|
|
||||||
|
|
||||||
/*debug
|
/*debug
|
||||||
private int debugTitleBarHeight;
|
private int debugTitleBarHeight;
|
||||||
private List<Rectangle> debugHitTestSpots;
|
private List<Rectangle> debugHitTestSpots;
|
||||||
|
|||||||
Reference in New Issue
Block a user