mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Merge branch 'upload_widget_overlap' of https://github.com/mig5/onionshare into mig5-upload_widget_overlap
This commit is contained in:
commit
fbb55e36dc
@ -38,6 +38,7 @@ class File(QtWidgets.QWidget):
|
|||||||
|
|
||||||
# Filename label
|
# Filename label
|
||||||
self.filename_label = QtWidgets.QLabel(self.filename)
|
self.filename_label = QtWidgets.QLabel(self.filename)
|
||||||
|
self.filename_label_width = self.filename_label.width()
|
||||||
|
|
||||||
# File size label
|
# File size label
|
||||||
self.filesize_label = QtWidgets.QLabel()
|
self.filesize_label = QtWidgets.QLabel()
|
||||||
@ -214,6 +215,8 @@ class Uploads(QtWidgets.QScrollArea):
|
|||||||
self.common = common
|
self.common = common
|
||||||
self.common.log('Uploads', '__init__')
|
self.common.log('Uploads', '__init__')
|
||||||
|
|
||||||
|
self.resizeEvent = None
|
||||||
|
|
||||||
self.uploads = {}
|
self.uploads = {}
|
||||||
|
|
||||||
self.setWindowTitle(strings._('gui_uploads', True))
|
self.setWindowTitle(strings._('gui_uploads', True))
|
||||||
@ -292,3 +295,16 @@ class Uploads(QtWidgets.QScrollArea):
|
|||||||
|
|
||||||
self.no_uploads_label.show()
|
self.no_uploads_label.show()
|
||||||
self.resize(self.sizeHint())
|
self.resize(self.sizeHint())
|
||||||
|
|
||||||
|
def resizeEvent(self, event):
|
||||||
|
width = self.frameGeometry().width()
|
||||||
|
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)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user