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

Tweak resize behavior to avoid text cutoff #599

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

eloquence
Copy link
Member

@eloquence eloquence commented Aug 6, 2020

Status

Ready for review

Description of Changes

Fixes #597. Enforces a maximum and minimum size while allowing text to take up as much space as needed, even if font size changes.

  • Assign a grid layout to the QDialog to ensure it reflows with resize
  • Match QDialog class to generated UI code in multiple inheritance
  • Set size policy for long text to "minimum" to ensure it always allocates as much space as needed
  • Set a maximum to allow for some adjustment by the user

Testing

Default font size:

  1. Apply the changes in this PR to the launcher versions in /opt/securedrop/launcher and /srv/salt/launcher (if only the /opt copy is overwritten, the updater itself will replace it on the next run).
  2. Run /opt/securedrop/launcher/sdw-launcher.py --skip-delta 0. This forces an updater run.
  3. While the updater runs, attempt to resize the window. Note that you can do so up to a maximum and minimum size.
  • Observe that no text has been cut off.

Increased font size:

  1. Under System->Appearance in dom0, increase the "Default Font" to a very high value, e.g., 17.
  2. Re-run the updater as above.
  • Observe that no text has been cut off.

Checklist

  • Linter (make flake8) passes in the development environment

- Assign a grid layout to the QDialog to ensure it reflows with
  resize
- Match QDialog class to generated UI code in multiple inheritance
- Set size policy for long text to "minimum" to ensure it always
  allocates as much space as needed
- Set a maximum to allow for some adjustment by the user
@eloquence eloquence marked this pull request as ready for review August 6, 2020 01:16
@eloquence eloquence added this to Ready for Review in SecureDrop Team Board Aug 6, 2020
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Observe that no text has been cut off.
    Increased font size:
  • Observe that no text has been cut off.

Nice fix

@sssoleileraaa sssoleileraaa merged commit 672e30a into main Aug 25, 2020
SecureDrop Team Board automation moved this from Ready for Review to Done Aug 25, 2020
@eloquence eloquence mentioned this pull request Oct 23, 2020
36 tasks
@legoktm legoktm deleted the 597-updater-resizing-fix branch May 28, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Ensure preflight updater scales with text contents
2 participants