mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-29 01:06:16 -05:00
Fix indicator label display for receive mode
This commit is contained in:
parent
4b3a68bb65
commit
b4de634b7a
@ -40,7 +40,7 @@ class ReceiveModeInfo(QtWidgets.QWidget):
|
||||
# Toggle button
|
||||
self.toggle_button = QtWidgets.QPushButton()
|
||||
self.toggle_button.setDefault(False)
|
||||
self.toggle_button.setFixedWidth(30)
|
||||
self.toggle_button.setFixedWidth(35)
|
||||
self.toggle_button.setFixedHeight(30)
|
||||
self.toggle_button.setFlat(True)
|
||||
self.toggle_button.setIcon( QtGui.QIcon(self.common.get_resource_path('images/uploads_toggle.png')) )
|
||||
@ -48,7 +48,7 @@ class ReceiveModeInfo(QtWidgets.QWidget):
|
||||
|
||||
# Keep track of indicator
|
||||
self.indicator_count = 0
|
||||
self.indicator_label = QtWidgets.QLabel()
|
||||
self.indicator_label = QtWidgets.QLabel(parent=self.toggle_button)
|
||||
self.indicator_label.setStyleSheet(self.common.css['download_uploads_indicator'])
|
||||
self.update_indicator()
|
||||
|
||||
@ -57,7 +57,6 @@ class ReceiveModeInfo(QtWidgets.QWidget):
|
||||
layout.addStretch()
|
||||
layout.addWidget(self.in_progress_uploads_count)
|
||||
layout.addWidget(self.completed_uploads_count)
|
||||
layout.addWidget(self.indicator_label)
|
||||
layout.addWidget(self.toggle_button)
|
||||
self.setLayout(layout)
|
||||
|
||||
@ -77,6 +76,8 @@ class ReceiveModeInfo(QtWidgets.QWidget):
|
||||
if self.indicator_count == 0:
|
||||
self.indicator_label.hide()
|
||||
else:
|
||||
size = self.indicator_label.sizeHint()
|
||||
self.indicator_label.setGeometry(35-size.width(), 0, size.width(), size.height())
|
||||
self.indicator_label.show()
|
||||
|
||||
def update_uploads_completed(self):
|
||||
|
@ -57,14 +57,6 @@ class ShareModeInfo(QtWidgets.QWidget):
|
||||
self.indicator_label.setStyleSheet(self.common.css['download_uploads_indicator'])
|
||||
self.update_indicator()
|
||||
|
||||
"""
|
||||
# Add it to the toggle button
|
||||
toggle_button_layout = QtWidgets.QHBoxLayout()
|
||||
toggle_button_layout.addSpacing(10)
|
||||
toggle_button_layout.addWidget(self.indicator_label)
|
||||
self.toggle_button.setLayout(toggle_button_layout)
|
||||
"""
|
||||
|
||||
# Layout
|
||||
layout = QtWidgets.QHBoxLayout()
|
||||
layout.addWidget(self.label)
|
||||
|
Loading…
Reference in New Issue
Block a user