Skip to content

Conversation

@mugolnik
Copy link

@mugolnik mugolnik commented Dec 9, 2025

Resolves: #27891

Summary

This PR allows for the full descriptions of instruments to remain accessible to users even in the event that their original descriptions became truncated. In order to avoid crowding the description text, it also enforces a maximumLineCount of 2, as decided in the linked report.

Specifics

As discussed, the targeted solution for this behavior was to expose a tooltip on hover of the description text. However, this tooltip should only show up if the text is truncated after taking up both lines. As far as I know, QML does not provide a native flag for detecting multi-line text truncation. Therefore this PR implements the isTruncated property:

isTruncated: Number of text lines is equal to the maximumLineCount (2) AND the contentWidth exceeds the width

This allowed for pretty good truncation state tracking (note I specified a buffer of 11 here to handle some inconsistencies, where this was the largest difference I observed when manually testing).

Then, using this property, the description text can be hovered over and if truncated a tooltip (as shown in the attachments) will appear below as requested.

Testing

  • Tested this locally, where the tooltip would be exposable only if the description was truncated and otherwise would not be.
  • Ran ctests, all passing except for an unrelated audio-specific one.

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)
Screenshot_4 Screenshot_3 Screenshot_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instrument descriptions get cut off in New Score dialog

1 participant