From 9d405b6c125872a0e50ef9a91aa06e3e7f85c7b2 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Tue, 22 Mar 2016 12:55:49 +0300 Subject: [PATCH] file transfer ui fix - too long data --- src/list_items.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/list_items.py b/src/list_items.py index 75fbfbf..c1929e5 100644 --- a/src/list_items.py +++ b/src/list_items.py @@ -174,7 +174,7 @@ class FileTransferItem(QtGui.QListWidget): font.setBold(True) self.name.setFont(font) self.name.setObjectName("name") - self.name.setText(user) + self.name.setText(user if len(user) <= 14 else user[:11] + '...') self.name.setStyleSheet('QLabel { color: black; }') self.time = QtGui.QLabel(self) @@ -219,7 +219,8 @@ class FileTransferItem(QtGui.QListWidget): file_size = '{}MB'.format(file_size / 1024) else: file_size = '{}KB'.format(file_size) - self.file_name.setText(u'{} {}'.format(file_size, file_name)) + file_data = u'{} {}'.format(file_size, file_name) + self.file_name.setText(file_data if len(file_data) <= 27 else file_data[:24] + '...') self.file_name.setStyleSheet('QLabel { color: black; }') self.saved_name = file_name