From 5066c54da24384a31d8a8815a865422ecbc37cd4 Mon Sep 17 00:00:00 2001 From: Phillipus Date: Sun, 7 Jan 2024 19:08:50 +0000 Subject: [PATCH] temp --- .../com/archimatetool/editor/ui/UIUtils.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/ui/UIUtils.java b/com.archimatetool.editor/src/com/archimatetool/editor/ui/UIUtils.java index 4b25c9993..76238c7ca 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/ui/UIUtils.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/ui/UIUtils.java @@ -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; @@ -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()); } }