-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing the Item height for Table and Tree when the default font is set #771
Conversation
Can you test this patch? |
Hi @elsazac, I've tested the patch on Mac M1 Ventura 13.6 and it does fix the row height problem testing with the Snippet in #771 and also in our RCP application. I remain puzzled, though, how and where the initial row height is set (25 pixels) before setting the font of the table or tree. |
@elsazac The problem also occurs for the eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java Lines 1178 to 1184 in 17dcab0
|
But why is the row height initially greater (25) on Silicon than on Intel (18)? Which is the correct height on Silicon? Does anyone know? |
@Phillipus I have made a similar change in List as well. |
Hi @elsazac - I tested and the fix works OK, thank-you. But before committing this patch I have a doubt concerning what should be the true initial row height. See comment here - #677 (comment) |
@Phillipus I have responded in the linked issue. Can you review and help progress this PR? |
It looks like this current incarnation sprinkles the appropriate magic numbers to fix the problem. I think #677 (comment) answers the outstanding problem. @Phillipus Are there any outstanding concerns with this PR? |
@merks Yes. The larger item height is seen on macOS
However, I recently installed a new JDK on an Intel Mac (x86_64) that has been compiled against Mac SDK 11.1 and when launching a child Eclipse, or our RCP app, the item height is also bigger. This is because when running a child Eclipse it uses the So the inconsistency is due not to OS architecture but on the linked SDK version of the launcher or the
I don't know how that is done (is it the equinox binaries project?) If this is done, however, note that Eclipse and RCP apps will not be able to run on macOS < 11 (before Big Sur) |
I see! Thank you for the detailed information!! Magic numbers never do feel quite right. 😱 |
I prefer not to have different code for x86 and arm implementation. My suggestion would be to use same masOS sdk for both versions of launcher. Here is the section from equinox project where we switch between macos 11 and macos 10.14 sdk for arm and intel architectures Removing this if condition and and rebuilding launcher should make make both versions of launcher work in the same way. If you need to upgrade to latest version of macos sdk you'll need to work with foundation to get it upgraded on the macos build machine |
@sravanlakkimsetti Thanks for that information! I notice that you did already do this here: eclipse-equinox/equinox@0dad463 but reverted this: eclipse-equinox/equinox@4db53c0 Did you revert because it was no longer needed due to #452 fixing itself? |
Opened eclipse-equinox/equinox#473 |
Not exactly. The problem was slightly complicated. At that time the supported java version was built with 10.14. When we moved to Macos 11, Eclipse had one behavior and the child, eclipse launched using run menu, had different behavior. For this reason we wanted to wait till java moved to Macos 11 before we move. Now that java also moved to Macos 11 we can move mow. Lets reinstate eclipse-equinox/equinox@0dad463 |
Could you do that? |
Sure will take it up |
For the Temurin version of Java this was a very recent move. Temurin Java 17 moved to SDK 11.1 with version jdk-17.0.9+9 - October 19 2023 Temurin Java 21 moved to SDK 11.1 with version jdk-21.0.1+12 - October 24 2023 |
Something to be aware of regarding using SDK 11 on the macOS Intel launcher in the future: This patch will need to change from: int height = (int)Math.ceil (ascent + descent) + ((OS.IS_X86_64) ? 1 : 8); to int height = (int)Math.ceil (ascent + descent) + 8; And this means that an end user will also see the increased item height if they are using an older JDK that was compiled with 10.14. |
It turns out that the Mac x86_64 launcher has been built with SDK 13 since around Eclipse 4.30. So we don't need to wait. @elsazac Could you update your patch by removing the |
done. |
Thanks. I tested this on both x86_64 and aarch64 and it works OK. However, a user will see discrepancies in Item height if they are launching a child Eclipse/RCP app using an older Java version (one compiled with Mac SDK 10.14). I guess in this case they should update to latest version. I'm happy with this PR now. I don't know if it needs more approval or who should commit it. |
526a37e
to
5fcb679
Compare
Is this ready to be merged now? |
Be aware that because of the increased item height in Lists, Tables and Trees, text is not vertically centered in the |
@elsazac In three places a value of 8 is added (it was 1). Do you think it would be a good idea to create a static constant in each class for this? Something like the existing |
I have added the changes and squashed the commits. Please have a look. |
Nit picky detail... The comment |
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.
I have updated the comments. |
Yes, that's a better more descriptive name too! 😄 |
Fixes: #677
A new function named as
getInset()
is created inTable.java
. This function calculates the inset value of a cell in a table for aarch64 architecture. The inset value of a row in a table is calculated by subtracting the height of a cell from a frame.This calculated inset value is added to the height insetItemHeight()
function.The inset value of 1 is retained for x86_64 architecture.
/cc @lshanmug