summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-05-25 17:18:31 -0700
committerMicah Lee <micah@micahflee.com>2021-05-25 17:18:31 -0700
commitb1810289314b8f34d39e77ff763f3b51a8116a19 (patch)
tree2d7bc1ebbebb03f969cdc5914db25e3366a1d413
parent40919dca6ff01b996eaf8fec44e6150a101864db (diff)
downloadonionshare-b1810289314b8f34d39e77ff763f3b51a8116a19.tar.gz
onionshare-b1810289314b8f34d39e77ff763f3b51a8116a19.zip
Change MinimumWidthWidget to MinimumSizeWidget, and use it for height in chat mode
-rw-r--r--desktop/src/onionshare/tab/mode/chat_mode/__init__.py7
-rw-r--r--desktop/src/onionshare/tab/mode/receive_mode/__init__.py4
-rw-r--r--desktop/src/onionshare/tab/mode/share_mode/__init__.py4
-rw-r--r--desktop/src/onionshare/tab/mode/website_mode/__init__.py4
-rw-r--r--desktop/src/onionshare/widgets.py9
5 files changed, 15 insertions, 13 deletions
diff --git a/desktop/src/onionshare/tab/mode/chat_mode/__init__.py b/desktop/src/onionshare/tab/mode/chat_mode/__init__.py
index 44990aa7..fe3e69f1 100644
--- a/desktop/src/onionshare/tab/mode/chat_mode/__init__.py
+++ b/desktop/src/onionshare/tab/mode/chat_mode/__init__.py
@@ -24,7 +24,7 @@ from onionshare_cli.web import Web
from .. import Mode
from .... import strings
-from ....widgets import MinimumWidthWidget
+from ....widgets import MinimumSizeWidget
from ....gui_common import GuiCommon
@@ -82,7 +82,8 @@ class ChatMode(Mode):
# Top bar
top_bar_layout = QtWidgets.QHBoxLayout()
- top_bar_layout.addStretch()
+ # Add space at the top, same height as the toggle history bar in other modes
+ top_bar_layout.addWidget(MinimumSizeWidget(0, 30))
# Main layout
self.main_layout = QtWidgets.QVBoxLayout()
@@ -90,7 +91,7 @@ class ChatMode(Mode):
self.main_layout.addWidget(header_label)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
- self.main_layout.addWidget(MinimumWidthWidget(700))
+ self.main_layout.addWidget(MinimumSizeWidget(700, 0))
# Column layout
self.column_layout = QtWidgets.QHBoxLayout()
diff --git a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py
index 425551a2..d07b5ffc 100644
--- a/desktop/src/onionshare/tab/mode/receive_mode/__init__.py
+++ b/desktop/src/onionshare/tab/mode/receive_mode/__init__.py
@@ -26,7 +26,7 @@ from onionshare_cli.web import Web
from ..history import History, ToggleHistory, ReceiveHistoryItem
from .. import Mode
from .... import strings
-from ....widgets import MinimumWidthWidget, Alert
+from ....widgets import MinimumSizeWidget, Alert
from ....gui_common import GuiCommon
@@ -183,7 +183,7 @@ class ReceiveMode(Mode):
self.main_layout.addWidget(header_label)
self.main_layout.addWidget(receive_warning)
self.main_layout.addWidget(self.primary_action, stretch=1)
- self.main_layout.addWidget(MinimumWidthWidget(525))
+ self.main_layout.addWidget(MinimumSizeWidget(525, 0))
# Row layout
content_row = QtWidgets.QHBoxLayout()
diff --git a/desktop/src/onionshare/tab/mode/share_mode/__init__.py b/desktop/src/onionshare/tab/mode/share_mode/__init__.py
index 3c93577d..4056d92e 100644
--- a/desktop/src/onionshare/tab/mode/share_mode/__init__.py
+++ b/desktop/src/onionshare/tab/mode/share_mode/__init__.py
@@ -29,7 +29,7 @@ from .. import Mode
from ..file_selection import FileSelection
from ..history import History, ToggleHistory, ShareHistoryItem
from .... import strings
-from ....widgets import MinimumWidthWidget
+from ....widgets import MinimumSizeWidget
from ....gui_common import GuiCommon
@@ -162,7 +162,7 @@ class ShareMode(Mode):
self.main_layout.addLayout(self.file_selection)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
- self.main_layout.addWidget(MinimumWidthWidget(700))
+ self.main_layout.addWidget(MinimumSizeWidget(700, 0))
# Column layout
self.column_layout = QtWidgets.QHBoxLayout()
diff --git a/desktop/src/onionshare/tab/mode/website_mode/__init__.py b/desktop/src/onionshare/tab/mode/website_mode/__init__.py
index a46f54bd..577ea28e 100644
--- a/desktop/src/onionshare/tab/mode/website_mode/__init__.py
+++ b/desktop/src/onionshare/tab/mode/website_mode/__init__.py
@@ -29,7 +29,7 @@ from .. import Mode
from ..file_selection import FileSelection
from ..history import History, ToggleHistory
from .... import strings
-from ....widgets import MinimumWidthWidget
+from ....widgets import MinimumSizeWidget
from ....gui_common import GuiCommon
@@ -160,7 +160,7 @@ class WebsiteMode(Mode):
self.main_layout.addLayout(self.file_selection)
self.main_layout.addWidget(self.primary_action, stretch=1)
self.main_layout.addWidget(self.server_status)
- self.main_layout.addWidget(MinimumWidthWidget(700))
+ self.main_layout.addWidget(MinimumSizeWidget(700, 0))
# Column layout
self.column_layout = QtWidgets.QHBoxLayout()
diff --git a/desktop/src/onionshare/widgets.py b/desktop/src/onionshare/widgets.py
index a1880a2e..c239d03a 100644
--- a/desktop/src/onionshare/widgets.py
+++ b/desktop/src/onionshare/widgets.py
@@ -84,14 +84,15 @@ class AddFileDialog(QtWidgets.QFileDialog):
QtWidgets.QDialog.accept(self)
-class MinimumWidthWidget(QtWidgets.QWidget):
+class MinimumSizeWidget(QtWidgets.QWidget):
"""
- An empty widget with a minimum width, just to force layouts to behave
+ An empty widget with a minimum width and height, just to force layouts to behave
"""
- def __init__(self, width):
- super(MinimumWidthWidget, self).__init__()
+ def __init__(self, width, height):
+ super(MinimumSizeWidget, self).__init__()
self.setMinimumWidth(width)
+ self.setMinimumHeight(height)
class Image(qrcode.image.base.BaseImage):