feat(settings): use radio buttons for gateway
This commit is contained in:
@@ -82,12 +82,10 @@ class SettingsTab(QWidget):
|
||||
for label, value in self.BACKEND_ITEMS:
|
||||
self.backend_combo.addItem(label, value)
|
||||
self.backend_combo.setVisible(False)
|
||||
self.gateway_default_button = QPushButton("默认网关")
|
||||
self.gateway_default_button = QRadioButton("默认网关")
|
||||
self.gateway_default_button.setObjectName("gatewayDefaultButton")
|
||||
self.gateway_default_button.setCheckable(True)
|
||||
self.gateway_custom_button = QPushButton("自定义网关")
|
||||
self.gateway_custom_button = QRadioButton("自定义网关")
|
||||
self.gateway_custom_button.setObjectName("gatewayCustomButton")
|
||||
self.gateway_custom_button.setCheckable(True)
|
||||
self.gateway_button_group = QButtonGroup(self)
|
||||
self.gateway_button_group.setExclusive(True)
|
||||
self.gateway_button_group.addButton(self.gateway_default_button)
|
||||
@@ -100,11 +98,11 @@ class SettingsTab(QWidget):
|
||||
gateway_selector_layout.addWidget(self.gateway_default_button)
|
||||
gateway_selector_layout.addWidget(self.gateway_custom_button)
|
||||
self.gateway_selector.setStyleSheet(
|
||||
"QPushButton { min-width: 108px; padding: 6px 12px; border: 1px solid #b8c0ca; "
|
||||
"background: #f6f8fa; color: #57606a; }"
|
||||
"QPushButton:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }"
|
||||
"QPushButton:last-child { border-left: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }"
|
||||
"QPushButton:checked { background: #0969da; border-color: #0969da; color: white; font-weight: 600; }"
|
||||
"QRadioButton { min-width: 108px; min-height: 30px; padding: 5px 12px; "
|
||||
"color: #24292f; spacing: 7px; }"
|
||||
"QRadioButton:hover { color: #0969da; }"
|
||||
"QRadioButton:focus { border: 1px solid #0969da; border-radius: 4px; }"
|
||||
"QRadioButton::indicator { width: 15px; height: 15px; }"
|
||||
)
|
||||
self.cmhub_base_url_edit = QLineEdit()
|
||||
self.cmhub_base_url_edit.setObjectName("cmhubBaseUrlEdit")
|
||||
|
||||
Reference in New Issue
Block a user