Adjusts spacing and padding of different parts

This commit is contained in:
Saptak S 2021-10-02 02:19:01 +05:30
parent 8e5da9558a
commit 6520d4ba25
No known key found for this signature in database
GPG Key ID: 7B7F1772C0C6FCBF
2 changed files with 34 additions and 7 deletions

View File

@ -22,6 +22,7 @@ from PySide2 import QtCore, QtWidgets, QtGui
from onionshare_cli.settings import Settings
from . import strings
from .gui_common import GuiCommon
@ -60,19 +61,30 @@ class AutoConnect(QtWidgets.QWidget):
self.image.setLayout(image_layout)
# Description and checkbox
description_label = QtWidgets.QLabel("Some description about OnionShare and explain autoconnect stuff")
description_label = QtWidgets.QLabel(strings._("gui_autoconnect_description"))
self.enable_autoconnect_checkbox = QtWidgets.QCheckBox()
self.enable_autoconnect_checkbox.clicked.connect(self.toggle_auto_connect)
self.enable_autoconnect_checkbox.setText(
"Enable automatically connecting to OnionShare"
strings._("gui_enable_autoconnect_checkbox")
)
self.enable_autoconnect_checkbox.setStyleSheet(
common.gui.css["enable_autoconnect"]
)
description_layout = QtWidgets.QVBoxLayout()
description_layout.addWidget(description_label)
description_layout.addWidget(self.enable_autoconnect_checkbox)
description_widget = QtWidgets.QWidget()
description_widget.setLayout(description_layout)
# CTA buttons
self.connect_button = QtWidgets.QPushButton("Start OnionShare")
self.connect_button = QtWidgets.QPushButton(strings._("gui_autoconnect_start"))
self.connect_button.setStyleSheet(
common.gui.css["server_status_button_stopped"]
common.gui.css["autoconnect_start_button"]
)
self.configure_button = QtWidgets.QPushButton(strings._("gui_autoconnect_configure"))
self.configure_button.setStyleSheet(
common.gui.css["autoconnect_configure_button"]
)
self.configure_button = QtWidgets.QPushButton("Configure")
cta_layout = QtWidgets.QHBoxLayout()
cta_layout.addWidget(self.connect_button)
cta_layout.addWidget(self.configure_button)
@ -85,8 +97,7 @@ class AutoConnect(QtWidgets.QWidget):
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.addStretch()
self.layout.addWidget(self.image)
self.layout.addWidget(description_label)
self.layout.addWidget(self.enable_autoconnect_checkbox)
self.layout.addWidget(description_widget)
self.layout.addStretch()
self.layout.addWidget(cta_widget)
self.layout.addStretch()

View File

@ -147,6 +147,22 @@ class GuiCommon:
QStatusBar::item {
border: 0px;
}""",
"autoconnect_start_button": """
QPushButton {
background-color: #5fa416;
color: #ffffff;
padding: 10px 30px;
border: 0;
border-radius: 5px;
}""",
"autoconnect_configure_button": """
QPushButton {
padding: 9px 29px;
}""",
"enable_autoconnect": """
QCheckBox {
margin-top: 30px;
}""",
# Common styles between modes and their child widgets
"mode_settings_toggle_advanced": """
QPushButton {