From c08f6f3db1b9d0ea545a83949b55958724537861 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 19 Sep 2018 10:57:12 +1000 Subject: [PATCH] #704 wrap the upload filename label if too long --- onionshare_gui/receive_mode/uploads.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/onionshare_gui/receive_mode/uploads.py b/onionshare_gui/receive_mode/uploads.py index 1aebe902..e04e0269 100644 --- a/onionshare_gui/receive_mode/uploads.py +++ b/onionshare_gui/receive_mode/uploads.py @@ -19,6 +19,7 @@ along with this program. If not, see . """ import os import subprocess +import textwrap from datetime import datetime from PyQt5 import QtCore, QtWidgets, QtGui @@ -305,10 +306,7 @@ class Uploads(QtWidgets.QScrollArea): try: for upload in self.uploads.values(): for item in upload.files.values(): - if item.filename_label_width > width: - item.filename_label.setText(item.filename[:25] + '[...]') - item.adjustSize() - if width > item.filename_label_width: - item.filename_label.setText(item.filename) + item.filename_label.setText(textwrap.fill(item.filename, 30)) + item.adjustSize() except: pass