diff --git a/onionshare/common.py b/onionshare/common.py index 78b6e2d7..3489c3e6 100644 --- a/onionshare/common.py +++ b/onionshare/common.py @@ -248,8 +248,15 @@ class Common(object): border-radius: 5px; }""", - 'downloads_uploads': """ - background-color: #ffffff; + 'downloads_uploads_empty': """ + QWidget { + background-color: #ffffff; + border: 1px solid #999999; + } + QWidget QLabel { + background-color: none; + border: 0px; + } """, 'downloads_uploads_empty_text': """ @@ -262,6 +269,8 @@ class Common(object): font-weight: bold; font-size 14px; text-align: center; + background-color: none; + border: none; }""", 'downloads_uploads_clear': """ diff --git a/onionshare_gui/share_mode/downloads.py b/onionshare_gui/share_mode/downloads.py index 3da88bc4..fcf8bc8e 100644 --- a/onionshare_gui/share_mode/downloads.py +++ b/onionshare_gui/share_mode/downloads.py @@ -78,7 +78,7 @@ class Download(object): self.started) -class Downloads(QtWidgets.QScrollArea): +class Downloads(QtWidgets.QWidget): """ The downloads chunk of the GUI. This lists all of the active download progress bars. @@ -90,11 +90,6 @@ class Downloads(QtWidgets.QScrollArea): self.downloads = {} self.setMinimumWidth(350) - self.setStyleSheet(self.common.css['downloads_uploads']) - - # Scroll bar - self.vbar = self.verticalScrollBar() - self.vbar.rangeChanged.connect(self.resizeScroll) # When there are no downloads empty_image = QtWidgets.QLabel() @@ -109,6 +104,7 @@ class Downloads(QtWidgets.QScrollArea): empty_layout.addWidget(empty_text) empty_layout.addStretch() self.empty = QtWidgets.QWidget() + self.empty.setStyleSheet(self.common.css['downloads_uploads_empty']) self.empty.setLayout(empty_layout) # When there are downloads @@ -122,25 +118,29 @@ class Downloads(QtWidgets.QScrollArea): download_header.addWidget(downloads_label) download_header.addStretch() download_header.addWidget(clear_button) - self.not_empty = QtWidgets.QWidget() - self.not_empty.setLayout(download_header) - self.downloads_layout = QtWidgets.QVBoxLayout() + not_empty_layout = QtWidgets.QVBoxLayout() + not_empty_layout.addLayout(download_header) + not_empty_layout.addLayout(self.downloads_layout) + self.not_empty = QtWidgets.QWidget() + self.not_empty.setLayout(not_empty_layout) # Layout - self.widget = QtWidgets.QWidget() layout = QtWidgets.QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self.empty) layout.addWidget(self.not_empty) - layout.addLayout(self.downloads_layout) - layout.addStretch() - self.widget.setLayout(layout) - self.setWidget(self.widget) + self.setLayout(layout) # Reset once at the beginning self.reset() + """ + # Scroll bar + self.vbar = self.verticalScrollBar() + self.vbar.rangeChanged.connect(self.resizeScroll) + """ + def resizeEvent(self, event): """ When the widget resizes, resize the inner widget to match @@ -152,7 +152,8 @@ class Downloads(QtWidgets.QScrollArea): """ Scroll to the bottom of the window when the range changes. """ - self.vbar.setValue(maximum) + pass + #self.vbar.setValue(maximum) def add(self, download_id, total_bytes): """