Make ModeSettingsWidget a scroll area, and adjust all the stretches

This commit is contained in:
Micah Lee 2021-05-16 11:39:20 -04:00
parent e3d0376b5a
commit dc7b80e2ef
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
5 changed files with 15 additions and 11 deletions

View File

@ -87,11 +87,9 @@ class ChatMode(Mode):
# Main layout
self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addLayout(top_bar_layout)
self.main_layout.addStretch()
self.main_layout.addWidget(header_label)
self.main_layout.addWidget(self.primary_action)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
self.main_layout.addStretch()
self.main_layout.addWidget(MinimumWidthWidget(700))
# Column layout

View File

@ -23,7 +23,7 @@ from PySide2 import QtCore, QtWidgets
from ... import strings
class ModeSettingsWidget(QtWidgets.QWidget):
class ModeSettingsWidget(QtWidgets.QScrollArea):
"""
All of the common settings for each mode are in this widget
"""
@ -177,7 +177,15 @@ class ModeSettingsWidget(QtWidgets.QWidget):
layout.addWidget(self.public_checkbox)
layout.addWidget(self.advanced_widget)
layout.addWidget(self.toggle_advanced_button)
self.setLayout(layout)
layout.addStretch()
main_widget = QtWidgets.QWidget()
main_widget.setLayout(layout)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
self.setWidgetResizable(True)
self.setFrameShape(QtWidgets.QFrame.NoFrame)
self.setWidget(main_widget)
self.update_ui()

View File

@ -182,7 +182,7 @@ class ReceiveMode(Mode):
self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addWidget(header_label)
self.main_layout.addWidget(receive_warning)
self.main_layout.addWidget(self.primary_action)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(MinimumWidthWidget(525))
# Row layout
@ -191,10 +191,8 @@ class ReceiveMode(Mode):
content_row.addWidget(self.image)
row_layout = QtWidgets.QVBoxLayout()
row_layout.addLayout(top_bar_layout)
row_layout.addStretch()
row_layout.addLayout(content_row)
row_layout.addLayout(content_row, stretch=1)
row_layout.addWidget(self.server_status)
row_layout.addStretch()
# Column layout
self.column_layout = QtWidgets.QHBoxLayout()

View File

@ -160,7 +160,7 @@ class ShareMode(Mode):
self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addLayout(top_bar_layout)
self.main_layout.addLayout(self.file_selection)
self.main_layout.addWidget(self.primary_action)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
self.main_layout.addWidget(MinimumWidthWidget(700))

View File

@ -158,7 +158,7 @@ class WebsiteMode(Mode):
self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addLayout(top_bar_layout)
self.main_layout.addLayout(self.file_selection)
self.main_layout.addWidget(self.primary_action)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
self.main_layout.addWidget(MinimumWidthWidget(700))