file transfer ui fix - too long data

This commit is contained in:
ingvar1995 2016-03-22 12:55:49 +03:00
parent 1897fa762a
commit 9d405b6c12

View file

@ -174,7 +174,7 @@ class FileTransferItem(QtGui.QListWidget):
font.setBold(True) font.setBold(True)
self.name.setFont(font) self.name.setFont(font)
self.name.setObjectName("name") 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.name.setStyleSheet('QLabel { color: black; }')
self.time = QtGui.QLabel(self) self.time = QtGui.QLabel(self)
@ -219,7 +219,8 @@ class FileTransferItem(QtGui.QListWidget):
file_size = '{}MB'.format(file_size / 1024) file_size = '{}MB'.format(file_size / 1024)
else: else:
file_size = '{}KB'.format(file_size) 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.file_name.setStyleSheet('QLabel { color: black; }')
self.saved_name = file_name self.saved_name = file_name