Skip to content

Commit

Permalink
Merge pull request #7131 from kozlovsky/fix_column_size
Browse files Browse the repository at this point in the history
Fix the width of the Size column on Windows when the display scaling is more than 100%
  • Loading branch information
kozlovsky authored Nov 1, 2022
2 parents 0bb1eaf + f7fbe2a commit 77932e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tribler/gui/widgets/torrentfiletreewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ def fill_directory_sizes(self) -> int:
self.file_size = 0
for child in self.children:
self.file_size += child.fill_directory_sizes()
self.setText(SIZE_COL, format_size(float(self.file_size)))

# On Windows, with display scaling bigger than 100%, the width of the Size column may be too narrow to display
# the full text of the cell. Adding unbreakable spaces makes the column wider, so it can display all the info
non_breaking_spaces = '\u00A0\u00A0'

self.setText(SIZE_COL, format_size(float(self.file_size)) + non_breaking_spaces)
return self.file_size

def subtree_progress_update(self, updates, force_update=False, draw_progress_bars=False):
Expand Down

0 comments on commit 77932e2

Please sign in to comment.