mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-21 04:18:25 -04:00
Refactor how Mode layouts work, so the downstream Mode has more control over the UI
This commit is contained in:
parent
2ffcdbb108
commit
fc1902c1ee
3 changed files with 29 additions and 20 deletions
|
@ -72,24 +72,17 @@ class Mode(QtWidgets.QWidget):
|
|||
self.starting_server_step3.connect(self.start_server_step3)
|
||||
self.starting_server_error.connect(self.start_server_error)
|
||||
|
||||
# Primary action layout
|
||||
# Primary action
|
||||
# Note: It's up to the downstream Mode to add this to its layout
|
||||
self.primary_action_layout = QtWidgets.QVBoxLayout()
|
||||
self.primary_action_layout.addWidget(self.server_status)
|
||||
self.primary_action = QtWidgets.QWidget()
|
||||
self.primary_action.setLayout(self.primary_action_layout)
|
||||
|
||||
# Layout
|
||||
self.layout = QtWidgets.QVBoxLayout()
|
||||
self.layout.addWidget(self.primary_action)
|
||||
# Hack to allow a minimum width on self.layout
|
||||
min_width_widget = QtWidgets.QWidget()
|
||||
min_width_widget.setMinimumWidth(450)
|
||||
self.layout.addWidget(min_width_widget)
|
||||
|
||||
self.horizontal_layout_wrapper = QtWidgets.QHBoxLayout()
|
||||
self.horizontal_layout_wrapper.addLayout(self.layout)
|
||||
|
||||
self.setLayout(self.horizontal_layout_wrapper)
|
||||
# Hack to allow a minimum width on the main layout
|
||||
# Note: It's up to the downstream Mode to add this to its layout
|
||||
self.min_width_widget = QtWidgets.QWidget()
|
||||
self.min_width_widget.setMinimumWidth(450)
|
||||
|
||||
def init(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue