mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-24 14:30:29 -04:00
Add a stretch at the bottom of the downloads window, so that progess bars are always lined up at the top
This commit is contained in:
parent
506eb42ee1
commit
c39e47fa9c
1 changed files with 6 additions and 2 deletions
|
@ -114,9 +114,13 @@ class Downloads(QtWidgets.QWidget):
|
||||||
self.downloads_label.setStyleSheet('QLabel { font-weight: bold; font-size 14px; text-align: center; }')
|
self.downloads_label.setStyleSheet('QLabel { font-weight: bold; font-size 14px; text-align: center; }')
|
||||||
self.no_downloads_label = QtWidgets.QLabel(strings._('gui_no_downloads', True))
|
self.no_downloads_label = QtWidgets.QLabel(strings._('gui_no_downloads', True))
|
||||||
|
|
||||||
|
self.downloads_layout = QtWidgets.QVBoxLayout()
|
||||||
|
|
||||||
self.layout = QtWidgets.QVBoxLayout()
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
self.layout.addWidget(self.downloads_label)
|
self.layout.addWidget(self.downloads_label)
|
||||||
self.layout.addWidget(self.no_downloads_label)
|
self.layout.addWidget(self.no_downloads_label)
|
||||||
|
self.layout.addLayout(self.downloads_layout)
|
||||||
|
self.layout.addStretch()
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
def add_download(self, download_id, total_bytes):
|
def add_download(self, download_id, total_bytes):
|
||||||
|
@ -126,7 +130,7 @@ class Downloads(QtWidgets.QWidget):
|
||||||
# add it to the list
|
# add it to the list
|
||||||
download = Download(download_id, total_bytes)
|
download = Download(download_id, total_bytes)
|
||||||
self.downloads[download_id] = download
|
self.downloads[download_id] = download
|
||||||
self.layout.addWidget(download.progress_bar)
|
self.downloads_layout.addWidget(download.progress_bar)
|
||||||
|
|
||||||
def update_download(self, download_id, downloaded_bytes):
|
def update_download(self, download_id, downloaded_bytes):
|
||||||
"""
|
"""
|
||||||
|
@ -145,6 +149,6 @@ class Downloads(QtWidgets.QWidget):
|
||||||
Reset the downloads back to zero
|
Reset the downloads back to zero
|
||||||
"""
|
"""
|
||||||
for download in self.downloads.values():
|
for download in self.downloads.values():
|
||||||
self.layout.removeWidget(download.progress_bar)
|
self.downloads_layout.removeWidget(download.progress_bar)
|
||||||
download.progress_bar.close()
|
download.progress_bar.close()
|
||||||
self.downloads = {}
|
self.downloads = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue