Commit 611accb
cocoa: Enforce native item height for Table, Tree, List if necessary
Newer versions of macOS introduced a new style of table rows with a
padding that is larger than previously seen. This broke item height
computations (eclipse-platform#677). An attempt to fix this had the unexpected side
effect that now some UI elements in Eclipse IDE (and other apps with
"-Dorg.eclipse.swt.internal.carbon.smallFonts" enabled),
eclise.platform.ui eclipse-platform#1674, and it also broke compatibility with older
versions of macOS that did not have the additional padding.
This change reverts the previous fix, and adds logic to enforce the
native item height by default, without making assumption about the exact
height (which varies with "smallFonts", for example).
The setting can be controlled by a new System property,
org.eclipse.swt.internal.cocoa.useNativeItemHeight, that, if set to
false, overrules the default. This allows apps to bring brack the old
macOS behavior.
Lastly, update two tests in Test_org_eclipse_swt_widgets_List that made
assumptions about the item height being different for two small font
sizes -- this is no longer true when the native item height is enforced.
We now increase the font size of the second font such that this corner
case no longer matters.
Fixes eclipse-platform/eclipse.platform.ui#1674
Fixes eclipse-platform#6771 parent e87e11e commit 611accb
File tree
5 files changed
+47
-14
lines changed- bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
5 files changed
+47
-14
lines changedLines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
2404 | 2406 | | |
2405 | 2407 | | |
2406 | 2408 | | |
| 2409 | + | |
| 2410 | + | |
2407 | 2411 | | |
2408 | 2412 | | |
2409 | 2413 | | |
| |||
2502 | 2506 | | |
2503 | 2507 | | |
2504 | 2508 | | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
2505 | 2522 | | |
2506 | 2523 | | |
2507 | 2524 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
1178 | 1180 | | |
1179 | 1181 | | |
1180 | 1182 | | |
1181 | | - | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1182 | 1188 | | |
1183 | 1189 | | |
1184 | 1190 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
2821 | 2823 | | |
2822 | 2824 | | |
2823 | 2825 | | |
2824 | | - | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
2825 | 2830 | | |
2826 | 2831 | | |
2827 | 2832 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
3165 | 3167 | | |
3166 | 3168 | | |
3167 | 3169 | | |
3168 | | - | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
3169 | 3174 | | |
3170 | 3175 | | |
3171 | 3176 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
1625 | 1625 | | |
1626 | 1626 | | |
1627 | 1627 | | |
1628 | | - | |
| 1628 | + | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | 1631 | | |
| |||
0 commit comments