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

PlugLayout : Stop long summaries expanding widgets below. #1629

Merged
merged 1 commit into from
Jan 25, 2016

Conversation

johnhaddon
Copy link
Member

When the summary was getting too long, it was requesting more space, and expanding the width of the whole column. The plug widgets in the column were then also expanding to take advantage of the apparent extra space. But often the parent SplitContainer would actually be clipping the widened column to make it fit in the layout, so the long summary was actually just pushing the right hand edges of the plug widgets outside of the clipped area, causing a fair amount of user annoyance.

In an ideal world we'd use "..." to indicate that the summary text is being clipped, but this isn't straightforward, so has been omitted here. The underlying QLabel itself has no built-in functionality for elision, because it supports multiline rich text. It is possible to do manual elision inside a paintEvent() in the case of single line plain text, but we're actually using rich text markup in this case anyway, so the problem appears non-trivial.

One other option would be to use a fade-out gradient to indicate elision, probably based on the actual size not meeting the sizeHint requirements. It seems though that if we were to do this, it would make most sense to do it for the whole column rather than just the label, so we had a prettier visual indication of the plug widgets being clipped too.

So, in short, I wish to punt on the ellipsis for now. Assuming that's acceptable, this addresses IE shotgun ticket 8146.

When the summary was getting too long, it was requesting more space, and expanding the width of the whole column. The plug widgets in the column were then also expanding to take advantage of the apparent extra space. But often the parent SplitContainer would actually be clipping the widened column to make it fit in the layout, so the long summary was actually just pushing the right hand edges of the plug widgets outside of the clipped area, causing a fair amount of user annoyance.

In an ideal world we'd use "..." to indicate that the summary text is being clipped, but this isn't straightforward, so has been omitted here. The underlying QLabel itself has no built-in functionality for elision, because it supports multiline rich text. It is possible to do [manual elision inside a paintEvent()](http://comments.gmane.org/gmane.comp.lib.qt.general/26005) in the case of single line plain text, but we're actually using rich text markup in this case anyway, so the problem appears non-trivial.

One other option would be to use a [fade-out gradient to indicate elision](https://daniel.molkentin.net/2007/03/25/ellipsis-made-easy/), probably based on the actual size not meeting the sizeHint requirements. It seems though that if we were to do this, it would make most sense to do it for the whole column rather than just the label, so we had a prettier visual indication of the plug widgets being clipped too.
andrewkaufman added a commit that referenced this pull request Jan 25, 2016
PlugLayout : Stop long summaries expanding widgets below.
@andrewkaufman andrewkaufman merged commit e521256 into GafferHQ:master Jan 25, 2016
@johnhaddon johnhaddon deleted the sectionSummarySizing branch February 2, 2016 17:17
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.

2 participants