diff options
3 files changed, 19 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras index df9769d278..4c2856d05d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras @@ -4505,6 +4505,7 @@ <enum name="NSPushOnPushOffButton" swt_gen="true"></enum> <enum name="NSRadioButton" swt_gen="true"></enum> <enum name="NSRegularControlSize" swt_gen="true"></enum> + <enum name="NSRegularSquareBezelStyle" swt_gen="true"></enum> <enum name="NSResizableWindowMask" swt_gen="true"></enum> <enum name="NSRightMouseDown" swt_gen="true"></enum> <enum name="NSRightMouseDragged" swt_gen="true"></enum> diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 0d9cae9f46..b9dbad2584 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -2126,6 +2126,7 @@ public static final int NSProgressIndicatorPreferredThickness = 14; public static final int NSPushOnPushOffButton = 1; public static final int NSRadioButton = 4; public static final int NSRegularControlSize = 0; +public static final int NSRegularSquareBezelStyle = 2; public static final int NSResizableWindowMask = 8; public static final int NSRightMouseDown = 3; public static final int NSRightMouseDragged = 7; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java index 40d56b0bc2..c0a28e6fa1 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java @@ -618,6 +618,23 @@ void setBackgroundImage(NSImage image) { } } +void setBounds (int x, int y, int width, int height, boolean move, boolean resize) { + if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0 && (style & SWT.FLAT) == 0) { + int heightThreshold = 32; + if (display.smallFonts) { + heightThreshold = 28; + } + + NSButton button = (NSButton)view; + if (height > heightThreshold) { + button.setBezelStyle(OS.NSRegularSquareBezelStyle); + } else { + button.setBezelStyle(OS.NSRoundedBezelStyle); + } + } + super.setBounds(x, y, width, height, move, resize); +} + void setFont (NSFont font) { if (text != null) { ((NSButton)view).setAttributedTitle(createString()); |