From 6bbcd9130e6789f976266713585d88e4d8d582c2 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 7 Feb 2018 15:59:13 +1100 Subject: [PATCH 1/2] allow word wrap of URL QLabels, and set MinimumHeight so they don't get shrunk in the layout --- onionshare_gui/server_status.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 3f7e390c..1aff79f4 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -84,10 +84,14 @@ class ServerStatus(QtWidgets.QWidget): # URL layout url_font = QtGui.QFont() self.url_description = QtWidgets.QLabel(strings._('gui_url_description', True)) + self.url_description.setWordWrap(True) + self.url_description.setMinimumHeight(50) self.url_label = QtWidgets.QLabel() self.url_label.setStyleSheet('QLabel { color: #666666; font-size: 12px; }') self.url = QtWidgets.QLabel() self.url.setFont(url_font) + self.url.setWordWrap(True) + self.url.setMinimumHeight(60) self.url.setStyleSheet('QLabel { background-color: #ffffff; color: #000000; padding: 10px; border: 1px solid #666666; }') url_buttons_style = 'QPushButton { color: #3f7fcf; }' From 27e2323edc755ce69fe67a850399b10281722930 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 7 Feb 2018 16:00:48 +1100 Subject: [PATCH 2/2] Call update_primary_action when server is stopped. Because it runs adjustSize(), it will shrink the window back down to a sane size once the URL label widgets get hidden, instead of growing the FileList widget to fill up the space --- onionshare_gui/onionshare_gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index b997a8b7..39e43560 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -77,6 +77,7 @@ class OnionShareGui(QtWidgets.QMainWindow): self.server_status.server_stopped.connect(self.file_selection.server_stopped) self.server_status.server_stopped.connect(self.stop_server) self.server_status.server_stopped.connect(self.update_server_status_indicator) + self.server_status.server_stopped.connect(self.update_primary_action) self.start_server_finished.connect(self.clear_message) self.start_server_finished.connect(self.server_status.start_server_finished) self.start_server_finished.connect(self.update_server_status_indicator)