Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,9 @@
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
</method>
<method selector="sizeToFit" swt_gen="true">
<retval swt_gen="true"></retval>
</method>
<method selector="startAnimation:" swt_gen="true">
<arg swt_gen="true"></arg>
<retval swt_gen="true"></retval>
Expand Down Expand Up @@ -4491,7 +4494,6 @@
<enum name="NSPortraitOrientation" swt_gen="true"></enum>
<enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum>
<enum name="NSPrintPanelShowsPrintSelection" swt_gen="true"></enum>
<enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum>
<enum name="NSColorSpaceModelRGB" swt_gen="true"></enum>

<enum name="NSRegularSquareBezelStyle" swt_gen="true"></enum>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.internal.cocoa;

Expand Down Expand Up @@ -63,6 +60,10 @@ public void setUsesThreadedAnimation(boolean usesThreadedAnimation) {
OS.objc_msgSend(this.id, OS.sel_setUsesThreadedAnimation_, usesThreadedAnimation);
}

public void sizeToFit() {
OS.objc_msgSend(this.id, OS.sel_sizeToFit);
}

public void startAnimation(id sender) {
OS.objc_msgSend(this.id, OS.sel_startAnimation_, sender != null ? sender.id : 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2280,7 +2280,6 @@ public static Selector getSelector (long value) {
public static final int NSPortraitOrientation = 0;
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
public static final int NSPrintPanelShowsPrintSelection = 32;
public static final int NSProgressIndicatorPreferredThickness = 14;
public static final int NSColorSpaceModelRGB = 1;
public static final int NSControlSizeRegular = 0;
public static final int NSRegularSquareBezelStyle = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ static int checkStyle (int style) {
@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int size = OS.NSProgressIndicatorPreferredThickness;
NSProgressIndicator widget = (NSProgressIndicator)view;
NSRect oldFrame = widget.frame();
widget.sizeToFit();
int size = (int)widget.frame().height;
widget.setFrame(oldFrame);
int width = 0, height = 0;
if ((style & SWT.HORIZONTAL) != 0) {
height = size;
Expand Down
Loading