Skip to content
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

Open
guiv42 opened this issue Jun 4, 2023 · 11 comments
Open

string truncated in Add measure dialog (SWT) #52

guiv42 opened this issue Jun 4, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@guiv42
Copy link
Collaborator

guiv42 commented Jun 4, 2023

see screenshot, selected radio button:
addMeasureDialog_en_swt

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)

@guiv42
Copy link
Collaborator Author

guiv42 commented Jun 7, 2023

This one is really puzzling me...

  • not reproduced with JFX
  • not reproduced with windows 10
  • not reproduced with Ubuntu
  • not even reproduced with OpenSUSE Leap 15.4 !

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.
This is really annoying because it gives an impression of a very poor global quality.

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.

OS framework computed size effective size
OpenSUSE tumbleweed swt <= 4.9 268 263
OpenSUSE tumbleweed swt >= 4.10 258 261 (if it wasn't truncated)
OpenSUSE tumbleweed jfx 257.2 256
OpenSUSE Leap 15.4 swt 4.13 279 272
Win10 swt 4.13 237 237
Ubuntu swt 4.13 298 294

Note: comparison of values between different OSes is not relevant (different display configurations)
So:

  • something clearly changed between SWT 4.9 and 4.10: 10px lost, it's not negligible
  • up to current version (4.27) SWT behaves as 4.10
  • there is only one configuration where computed size < effective size
  • in this configuration, the width computation is clearly erroneous: the object does not fit within the computed space

Looks like an integration problem between SWT and OpenSUSE tumbleweed.
I can't convince myself this can be a SWT bug: if so trivial to reproduce, could it survive in SWT from version 4.10 to current 4.27?
And since tumbleweed is a rolling release, it could be subject to change without notice...

Could someone perform the test in another distro (ex. debian), and/or macOS? at least check visually it the problem is reproduced?
See "Measure/Add" (1st item) and "Composition/Tempo" (last item)

I don't know what to do if the problem is only present in my configuration...

@guiv42
Copy link
Collaborator Author

guiv42 commented Jun 9, 2023

It really looks like an OpenSUSE tumbleweed issue:

  • reproduced with TG1.5.4 installed as rpm from official repo
  • not reproduced with TG1.5.6 installed as flatpak

@helge17
Copy link
Owner

helge17 commented Jun 30, 2023

"Add Measure" dialog with a current build:

FreeBSD (SWT & Gnome): OK
MacOS (SWT): OK
Windows 10 (SWT, JFE): OK
Debian 11 (SWT, JFX & KDE on Hardware/Laptop): OK
Debian 12 (JFX & KDE on VM): OK

Debian 12 (SWT & KDE on VM): truncated
I tested the build from the Debian 11 Laptop and a local build on Debian 12: Both show the error.

@guiv42
Copy link
Collaborator Author

guiv42 commented Jul 1, 2023

OK, so I think we cannot leave this issue like this.
Possibly a SWT/KDE integration issue? Don't know how to solve this... The only workaround I can think of is to add an arbitrary margin to the width of radio buttons and checkboxes computed by SWT. Definitely not clean.
Any other idea?

guiv42 added a commit to guiv42/tuxguitar that referenced this issue Jul 28, 2023
@guiv42
Copy link
Collaborator Author

guiv42 commented Jul 28, 2023

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.
It does not seem consistent to me when I look at SWT doc: this parameter is supposed to configure "automatic line wrap behavior"
Yet I have only tested it in OpenSuse tumbleweed (for technical reasons I do not have access to my Win machine currently).
@helge17: could you please test last version in my experimental branch in other environments?

edit: behavior of checkboxes can be tested in French version, menu "Composition/Clé", the checkbox label is truncated

@helge17
Copy link
Owner

helge17 commented Aug 4, 2023

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:

  • Without the commit:
    Screenshot_MacOS_vanilla_dark_add_measure
    Screenshot_MacOS_vanilla_dark_settings

  • With commit:
    Screenshot_MacOS_c884450_dark_add_measure
    Screenshot_MacOS_c884450_dark_settings

Besides that, I haven't noticed any other negative side effects (Windows, FreeBSD, Debian 11).

@guiv42
Copy link
Collaborator Author

guiv42 commented Aug 6, 2023

Thank you very much for the tests. For sure this side effect was not expected.
It seems to me that this isn't an acceptable workaround. So, I'll have a look at the other (dirty) workaround I suggested above: to add an arbitrary horizontal margin in Linux version.
What is your opinion ?

@Sy256
Copy link

Sy256 commented Aug 6, 2023

Chiming in to say I do not have this issue on the mac version 7-27
Screen Shot 2023-08-06 at 10 48 52 AM

I also tried changing skins (which I'd never do except for testing, I like the default Oxygen) and they do not work at all, instead of turning to the theme colors they just turn into a harder to view nothing-color, so I can't test that

@helge17
Copy link
Owner

helge17 commented Aug 8, 2023

Thank you very much for the tests. For sure this side effect was not expected. It seems to me that this isn't an acceptable workaround. So, I'll have a look at the other (dirty) workaround I suggested above: to add an arbitrary horizontal margin in Linux version. What is your opinion ?

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.
I tend to just ignore the problem and wait to see if it goes away with future Linux updates. After all, it's not that critical.

But anyway, if you prefer to add a workaround, I'll merge it.

@helge17
Copy link
Owner

helge17 commented Aug 8, 2023

Chiming in to say I do not have this issue on the mac version 7-27

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.

I also tried changing skins (which I'd never do except for testing, I like the default Oxygen) and they do not work at all, instead of turning to the theme colors they just turn into a harder to view nothing-color, so I can't test that

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.

@guiv42 guiv42 added the bug Something isn't working label Jan 4, 2024
@guiv42 guiv42 self-assigned this Jan 4, 2024
guiv42 added a commit to guiv42/tuxguitar that referenced this issue Jan 19, 2024
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
@guiv42
Copy link
Collaborator Author

guiv42 commented Jan 22, 2024

A workaround is implemented by PR #224
I suggest to leave this issue open. If external bug is fixed one day, it would be cleaner to remove this workaround.

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants