From f2dbc972857a7963c82801ebae676b4a70f41c81 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Wed, 13 Oct 2021 20:34:11 -0700 Subject: [PATCH] Improve layout of SettingsDialog --- desktop/src/onionshare/gui_common.py | 2 +- .../src/onionshare/resources/locale/en.json | 2 +- desktop/src/onionshare/settings_dialog.py | 20 ++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/desktop/src/onionshare/gui_common.py b/desktop/src/onionshare/gui_common.py index a9539714..cb10eb3b 100644 --- a/desktop/src/onionshare/gui_common.py +++ b/desktop/src/onionshare/gui_common.py @@ -395,7 +395,7 @@ class GuiCommon: # Settings dialogs "settings_version": """ QLabel { - color: #666666; + font-size: 16px; }""", "settings_whats_this": """ QLabel { diff --git a/desktop/src/onionshare/resources/locale/en.json b/desktop/src/onionshare/resources/locale/en.json index f0dd7a6a..38da16fb 100644 --- a/desktop/src/onionshare/resources/locale/en.json +++ b/desktop/src/onionshare/resources/locale/en.json @@ -126,7 +126,7 @@ "error_cannot_create_data_dir": "Could not create OnionShare data folder: {}", "gui_receive_mode_warning": "Receive mode lets people upload files to your computer.

Some files can potentially take control of your computer if you open them. Only open things from people you trust, or if you know what you are doing.", "gui_open_folder_error": "Failed to open folder with xdg-open. The file is here: {}", - "gui_settings_language_label": "Preferred language", + "gui_settings_language_label": "Language", "gui_settings_theme_label": "Theme", "gui_settings_theme_auto": "Auto", "gui_settings_theme_light": "Light", diff --git a/desktop/src/onionshare/settings_dialog.py b/desktop/src/onionshare/settings_dialog.py index de5c6992..5bb7be1c 100644 --- a/desktop/src/onionshare/settings_dialog.py +++ b/desktop/src/onionshare/settings_dialog.py @@ -71,6 +71,17 @@ class SettingsDialog(QtWidgets.QDialog): self.system = platform.system() + # Header + version_label = QtWidgets.QLabel(f"OnionShare {self.common.version}") + version_label.setStyleSheet(self.common.gui.css["settings_version"]) + self.help_button = QtWidgets.QPushButton(strings._("gui_settings_button_help")) + self.help_button.clicked.connect(self.help_clicked) + header_layout = QtWidgets.QHBoxLayout() + header_layout.addStretch() + header_layout.addWidget(version_label) + header_layout.addWidget(self.help_button) + header_layout.addStretch() + # Automatic updates options # Autoupdate @@ -142,24 +153,19 @@ class SettingsDialog(QtWidgets.QDialog): strings._("gui_settings_button_cancel") ) self.cancel_button.clicked.connect(self.cancel_clicked) - version_label = QtWidgets.QLabel(f"OnionShare {self.common.version}") - version_label.setStyleSheet(self.common.gui.css["settings_version"]) - self.help_button = QtWidgets.QPushButton(strings._("gui_settings_button_help")) - self.help_button.clicked.connect(self.help_clicked) buttons_layout = QtWidgets.QHBoxLayout() - buttons_layout.addWidget(version_label) - buttons_layout.addWidget(self.help_button) buttons_layout.addStretch() buttons_layout.addWidget(self.save_button) buttons_layout.addWidget(self.cancel_button) # Layout layout = QtWidgets.QVBoxLayout() + layout.addLayout(header_layout) + layout.addSpacing(20) layout.addWidget(autoupdate_group) if autoupdate_group.isVisible(): layout.addSpacing(20) layout.addLayout(language_layout) - layout.addSpacing(20) layout.addLayout(theme_layout) layout.addSpacing(20) layout.addStretch()