-
Notifications
You must be signed in to change notification settings - Fork 42
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
Elide source designation at lower window widths #1145
Conversation
7807daf
to
df72972
Compare
OK, this was pretty painful to debug, but it seems like the best way to avoid layout problems while resizing the window is to allocate a generous fixed width to the label while its actual contents change. That way Qt won't attempt to reflow the composite placeholder widget in sometimes broken ways. Now to test this in Qubes! |
In my testing resize behavior is correct in Qubes :) |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a first pass on your implementation and agree with your approach on changing max_length based on window size. all you need is test coverage and i'd say this is good to go in. let me know if you'd like help on writing the tests.
source_name.setObjectName("ReplyTextEditPlaceholder_bold_blue") | ||
self.source_name = source_name | ||
self.source_name_label = SecureQLabel( | ||
source_name, wordwrap=False, max_length=self.INITIAL_MAX_WIDTH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, setting max_length here will turn on elided text
@@ -3133,8 +3133,25 @@ def setText(self, text): | |||
self.placeholder.hide() | |||
super(ReplyTextEdit, self).setPlainText(text) | |||
|
|||
def resizeEvent(self, event): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hooking into the resize event works as expected
cd3e680
to
bcd1971
Compare
Awesome, thanks for the review @creviera! :) We're at 100% coverage now and the test verifies the basic behavior implemented here. Please let me know if it's consistent with our approach to testing these widgets, happy to tweak. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Resolves #1120
Status
Ready for review
Description
Elides the source designation if needed as the window is resized, while allocating a fixed width to the label to ensure that layout is not disrupted.
Testing
Checklist