mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-14 00:39:33 -05:00
Increase minimum window with to 460, and store it in a variable to stop repeating myself
This commit is contained in:
parent
8ca34fadd9
commit
39dd0862d4
@ -50,7 +50,7 @@ class Mode(QtWidgets.QWidget):
|
||||
|
||||
self.filenames = filenames
|
||||
|
||||
self.setMinimumWidth(450)
|
||||
self.setMinimumWidth(self.common.min_window_width)
|
||||
|
||||
# The web object gets created in init()
|
||||
self.web = None
|
||||
@ -83,7 +83,7 @@ class Mode(QtWidgets.QWidget):
|
||||
# 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)
|
||||
self.min_width_widget.setMinimumWidth(self.common.min_window_width)
|
||||
|
||||
def init(self):
|
||||
"""
|
||||
|
@ -45,6 +45,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||
|
||||
self.common = common
|
||||
self.common.log('OnionShareGui', '__init__')
|
||||
self.common.min_window_width = 460
|
||||
|
||||
self.onion = onion
|
||||
self.qtapp = qtapp
|
||||
@ -169,7 +170,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||
self.show()
|
||||
|
||||
# Adjust window size, to start with a minimum window width
|
||||
self.adjust_size(450)
|
||||
self.adjust_size(self.common.min_window_width)
|
||||
|
||||
# The server isn't active yet
|
||||
self.set_server_active(False)
|
||||
@ -474,6 +475,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||
|
||||
# Adjust sizes of each mode
|
||||
for mode in [self.share_mode, self.receive_mode]:
|
||||
self.qtapp.processEvents()
|
||||
adjust_size_widget(mode)
|
||||
|
||||
# Adjust window size
|
||||
|
@ -194,7 +194,7 @@ class ReceiveMode(Mode):
|
||||
self.resize_window()
|
||||
|
||||
def resize_window(self):
|
||||
min_width = 450
|
||||
min_width = self.common.min_window_width
|
||||
if self.uploads.isVisible():
|
||||
min_width += 300
|
||||
self.adjust_size.emit(min_width)
|
||||
|
@ -317,7 +317,7 @@ class ShareMode(Mode):
|
||||
self.downloads.reset()
|
||||
|
||||
def resize_window(self):
|
||||
min_width = 450
|
||||
min_width = self.common.min_window_width
|
||||
if self.downloads.isVisible():
|
||||
min_width += 300
|
||||
self.adjust_size.emit(min_width)
|
||||
|
Loading…
Reference in New Issue
Block a user