[Mac] Buttons with font sizes>23pt are not correctly rendered #3085#3086
[Mac] Buttons with font sizes>23pt are not correctly rendered #3085#3086xpomul wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
6da9e14 to
8026642
Compare
…-platform#3085 Fix the issue by handling the case when a button uses a custom font with size > 16pt. In this case adjust the button height in cellSizeForBounds(), similar to the other height adjustment fixes already present. Signed-off-by: Stefan Winkler <stefan@winklerweb.net>
|
@HeikoKlare can you review? |
|
I have to admit that I am probably not the right person to review this. I am not a common Mac user and not an expert in the SWT implementation for Cocoa. What I can contribute here is some testing and some considerations. Let's start with the testing: With respect to the idea of adapting the size of the button at all, it seems as if this is not intended by Apple. From what I find in their documentation, it seems as if they assume the standard font (13 pt?) to be used for buttons. And if buttons with variable height content shall be used, there seem to be specific controls or control configurations available: https://developer.apple.com/design/human-interface-guidelines/buttons |
|
Thanks @HeikoKlare for having a look. I was hoping to get in touch with someone who knows their way around Cocoa and whether there is a way to improve/work around the quirky behavior you have experienced (setting the same height leads to different results depending on whether a smaller or larger height was set before...). So far, I was not able to find one. Maybe it is a more general discussion how we deal with the strict implications from Apple.
That said, in the meantime, I have come across more parts where larger font sizes lead to issues with Apple's Cocoa implementation (e.g. Combo boxes). So there might be similar fixes needed (and maybe more strange behavior in Apple API to work around...) |
|
@vogella @HeikoKlare do you know if there is anyone else who could contribute to this discussion? |
|
@Phillipus can you help here? |
I share @HeikoKlare's concerns, but on the other hand this PR doesn't necessarily make things too worse. Apple's Human Interface Guidelines recommend standard button styles with 13pt text. Without this PR the font size is changed and the button doesn't change size. Hard to say one way or the other. |


Fix issue #3085 by handling the case when a button uses a custom font with size > 16pt. In this case adjust the button height in cellSizeForBounds(), similar to the other height adjustment fixes already present.