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
string truncated in Add measure dialog (SWT) #52
Comments
This one is really puzzling me...
but systematic with OpenSUSE tumbleweed + SWT. Other dialogs are concerned. I have the same problem with many dialogs in 2.0beta: with radio buttons and checkboxes. Here are the results of a few measures. I retrieved the width of the radio button computed by SWT, and the effective width (measured on screenshots, from 1st pixel of circle to last pixel of string). TuxGuitar retrieves the computed value and adapts dialog size accordingly.
Note: comparison of values between different OSes is not relevant (different display configurations)
Looks like an integration problem between SWT and OpenSUSE tumbleweed. Could someone perform the test in another distro (ex. debian), and/or macOS? at least check visually it the problem is reproduced? I don't know what to do if the problem is only present in my configuration... |
It really looks like an OpenSUSE tumbleweed issue:
|
"Add Measure" dialog with a current build: FreeBSD (SWT & Gnome): OK Debian 12 (SWT & KDE on VM): truncated |
OK, so I think we cannot leave this issue like this. |
A bit weird: playing around with different SWT parameters, it seems that adding a SWT.WRAP flag when creating SWT checkboxes and radio buttons solves the issue. Computed width of 1st radio button in "Measure/Add" dialog is then 268, exactly the value computed by the old SWT version. edit: behavior of checkboxes can be tested in French version, menu "Composition/Clé", the checkbox label is truncated |
The commit c884450 fixes the truncated string in Debian 12, but introduces a small issue with MacOS: In dark mode the text beside check boxes and radio buttons does not change to white, it stays black instead: Besides that, I haven't noticed any other negative side effects (Windows, FreeBSD, Debian 11). |
Thank you very much for the tests. For sure this side effect was not expected. |
The truncation problem occurs on Debian 12, but not on Debian 11, even when using exactly the same binary package. So it seems that the problem is related to a library or SWT and we can't really fix it in TuxGuitar. But anyway, if you prefer to add a workaround, I'll merge it. |
The problem is that the text beside check boxes and radio buttons is always black with commit c884450, in bright and in dark mode. All other texts are black in bright mode and white in dark mode, otherwise they are not visible. In bright mode you cannot see this specific problem as all texts are black as they should be.
You need to set your desktop to dark mode and then select a dark theme in TuxGuitar. The dark themes don't make TuxGuitar black, they just contain bright icons so you can see them easily when you have your desktop set to dark mode. |
in SWT configuration, with some versions of Linux/KDE, estimated width of checkboxes and radio buttons by SWT is underestimated This results in truncated strings shown to user This is NOT a fix, just a workaround. To be removed one day when external issue is fixed Consequence: some controls may have an extra (useless) margin of 10px on other platforms (Windows, mac, freebsd). I tried to add a parameter, so that the workaround would only apply to Linux version, but this would have required to add some dependencies between modules in pom files, I think it's not worth it. see helge17#52
A workaround is implemented by PR #224 It should be quite easy to detect when external bug is fixed: I get the same issue of truncated checkboxes/radiobuttons in Eclipse IDE itself... |
see screenshot, selected radio button:
note: it's even worse for languages where the strings are longer
OK with JFX configuration, even with long strings
(only tested with Linux)
edit: not a big surprise, introduced when upgrading SWT (bbfd27f)
The text was updated successfully, but these errors were encountered: