@@ -884,15 +884,12 @@ void drawClose(GC gc, Rectangle closeRect, int closeImageState, boolean showDirt
884
884
Color originalForeground = gc .getForeground ();
885
885
int state = closeImageState & (SWT .HOT | SWT .SELECTED | SWT .BACKGROUND );
886
886
if (state == SWT .NONE ) {
887
- if (showDirtyIndicator ) drawDirtyIndicator (gc , closeRect , originalForeground , false );
888
- drawCloseButton (gc , closeRect , false );
887
+ if (showDirtyIndicator )
888
+ drawDirtyIndicator (gc , closeRect , originalForeground , false );
889
+ else
890
+ drawCloseButton (gc , closeRect , false );
889
891
} else if (state == SWT .HOT || state == SWT .SELECTED ) {
890
- if (showDirtyIndicator ) {
891
- drawDirtyIndicator (gc , closeRect , originalForeground , true );
892
- drawCloseButton (gc , closeRect , false );
893
- } else {
894
- drawCloseButton (gc , closeRect , true );
895
- }
892
+ drawCloseButton (gc , closeRect , true );
896
893
} else if (state == SWT .BACKGROUND ) {
897
894
if (showDirtyIndicator )
898
895
drawDirtyIndicator (gc , closeRect , originalForeground , false );
@@ -905,15 +902,17 @@ void drawClose(GC gc, Rectangle closeRect, int closeImageState, boolean showDirt
905
902
}
906
903
907
904
private void drawDirtyIndicator (GC gc , Rectangle closeRect , Color originalForeground , boolean hot ) {
908
- Color indicatorColor = hot ? getFillColor () : originalForeground ;
909
- drawCloseBackground (gc , closeRect , indicatorColor );
905
+ Color originalBackground = gc .getBackground ();
906
+ gc .setBackground (originalForeground );
907
+ gc .fillOval (closeRect .x + 3 , closeRect .y + 4 , closeRect .width - 6 , closeRect .height - 6 );
908
+ gc .setBackground (originalBackground );
910
909
}
911
910
912
911
private void drawCloseBackground (GC gc , Rectangle closeRect , Color backgroundColor ) {
913
912
Color originalBackground = gc .getBackground ();
914
913
gc .setBackground (backgroundColor );
915
914
gc .setForeground (originalBackground );
916
- gc .fillRoundRectangle (closeRect .x + 3 , closeRect .y + 4 , closeRect .width - 5 , closeRect .height - 5 , 4 , 4 );
915
+ gc .fillRoundRectangle (closeRect .x + 1 , closeRect .y + 2 , closeRect .width - 2 , closeRect .height - 2 , 4 , 4 );
917
916
gc .setBackground (originalBackground );
918
917
}
919
918
@@ -925,7 +924,7 @@ private void drawCloseButton(GC gc, Rectangle closeRect, boolean hot) {
925
924
gc .setForeground (gc .getBackground ());
926
925
}
927
926
// draw X with length of this constant
928
- final int lineLength = 6 ;
927
+ final int lineLength = 9 ;
929
928
int x = closeRect .x + Math .max (1 , (closeRect .width -lineLength )/2 );
930
929
int y = closeRect .y + Math .max (1 , (closeRect .height -lineLength )/2 );
931
930
y += parent .onBottom ? -1 : 1 ;
0 commit comments