Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Jan 7, 2024
1 parent b5a2eef commit 5066c54
Showing 1 changed file with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;

Expand Down Expand Up @@ -247,11 +248,32 @@ public static String shortenText(String text, Control control, int margin) {


/**
* For some reason this will ensure that Table/Tree/List Item height is normal on Apple Silicon
* @param control
* @deprecated Use {@link fixMacItemHeight}
*/
public static void fixMacSiliconItemHeight(Control control) {
if(PlatformUtils.isAppleSilicon()) {

}

/**
* Table/Tree/List Item heights on Mac SDK Big Sur and later are taller than when using an earlier Mac SDK.
* However, if we change the font of a Table/Tree/List it will revert to the smaller item height.
*
* It depends on what binary is being run and what Mac SDK that binary was compiled against:
*
* Archi executable binary on Intel smaller height
* Archi executable binary on Silicon bigger height
* Java on Intel (launch from Eclipse) bigger height
* Java on Silicon (launch from Eclipse) bigger height
*
* To determine which Mac SDK is used to create the binary run:
* otool -l /path/to/binary
* and inspect the LC_VERSION_MIN_MACOSX or LC_BUILD_VERSION entry (look for "sdk")
*
* So call this method in all cases when running on Mac
* For some reason this will ensure that Table/Tree/List Item height is normal on Mac
*/
public static void fixMacItemHeight(Control control) {
if(PlatformUtils.isMac()) {
control.setFont(control.getFont());
}
}
Expand Down

0 comments on commit 5066c54

Please sign in to comment.