Skip to content

Commit

Permalink
Automatically resizes status bar to width of error message string.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Mar 23, 2020
1 parent e7f8761 commit e7ef860
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ def update_message(self, message: str, duration: int) -> None:
continuously show message.
"""
self.status_bar.showMessage(message, duration)
new_width = self.fontMetrics().horizontalAdvance(message)
self.status_bar.setMinimumWidth(new_width)
self.status_bar.reformat()

if duration != 0:
self.status_timer.start(duration)
Expand Down

0 comments on commit e7ef860

Please sign in to comment.