From 2d1da63728b3ce7bff178b15ce2656467cbcc70f Mon Sep 17 00:00:00 2001 From: Elsa Zacharia Date: Fri, 18 Aug 2023 22:38:41 +0530 Subject: [PATCH] Fixes: #677 For X_86_64 the hardcoded inset value was 1.It is retained as such.Since aarch64 was introduced at a very later time the new table format was introduced with extra paddings.So the appropriate value to get the same font would be 8. --- .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java | 5 ++++- .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java | 5 ++++- .../Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java index 9370f9788dd..59cb71af597 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java @@ -50,6 +50,9 @@ public class List extends Scrollable { static final int CELL_GAP = 1; + /* Row height for list item */ + static final int H_GAP = 8; + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. @@ -1179,7 +1182,7 @@ void setFont (NSFont font) { super.setFont (font); double ascent = font.ascender (); double descent = -font.descender () + font.leading (); - ((NSTableView)view).setRowHeight ((int)Math.ceil (ascent + descent) + 1); + ((NSTableView)view).setRowHeight ((int)Math.ceil (ascent + descent) + H_GAP); setScrollWidth(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java index c49f1354fee..195bf18b7d9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java @@ -93,6 +93,9 @@ public class Table extends Composite { static final int TEXT_GAP = 2; static final int CELL_GAP = 1; + /* Row height for table item */ + static final int H_GAP = 8; + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. @@ -2822,7 +2825,7 @@ void setItemHeight (Image image, NSFont font, boolean set) { if (font == null) font = getFont ().handle; double ascent = font.ascender (); double descent = -font.descender () + font.leading (); - int height = (int)Math.ceil (ascent + descent) + 1; + int height = (int)Math.ceil (ascent + descent) + H_GAP; Rectangle bounds = image != null ? image.getBounds () : imageBounds; if (bounds != null) { imageBounds = bounds; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java index 1c2de57fa6e..4d27511c399 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java @@ -109,6 +109,9 @@ public class Tree extends Composite { static final int TEXT_GAP = 2; static final int CELL_GAP = 1; + /* Row height for tree item */ + static final int H_GAP = 8; + /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. @@ -3170,7 +3173,7 @@ void setItemHeight (Image image, NSFont font, boolean set) { if (font == null) font = getFont ().handle; double ascent = font.ascender (); double descent = -font.descender () + font.leading (); - int height = (int)Math.ceil (ascent + descent) + 1; + int height = (int)Math.ceil (ascent + descent) + H_GAP; Rectangle bounds = image != null ? image.getBounds () : imageBounds; if (bounds != null) { imageBounds = bounds;