Synchronize TUN mode label availability

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-09-09 13:38:54 +08:00
parent 5bfdf73cbb
commit e4bf189b16
3 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -47,7 +47,8 @@ def baseStyleSheet(palette):
background-color: transparent;
}}
QLabel:disabled {{
QLabel:disabled,
QLabel#SettingsCardTitle:disabled {{
color: {palette['disabled']};
}}
+1
View File
@@ -944,6 +944,7 @@ class HomePage(Mixins.QTranslatable, QMainWindow):
"""Gate connection-sensitive Home controls during lifecycle transitions."""
self.systemProxyComboBox.setEnabled(bool(enabled))
self.tunModeSwitch.setEnabled(bool(enabled) and self._tunModeAvailable)
self.tunModeLabel.setEnabled(self.tunModeSwitch.isEnabled())
@QtCore.Slot()
def handleServerSelectionChanged(self, *_args):
+2
View File
@@ -649,6 +649,7 @@ class SettingsPage(Mixins.QTranslatable, QMainWindow):
_('Route system traffic through the active proxy connection.'),
)
self.tunModeCard.checkBox.setEnabled(self._tunModeAvailable)
self.tunModeCard.titleLabel.setEnabled(self.tunModeCard.checkBox.isEnabled())
AppSettingsController().tunModeChanged.connect(
self.tunModeCard.checkBox.syncCheckedAnimated
@@ -1123,6 +1124,7 @@ class SettingsPage(Mixins.QTranslatable, QMainWindow):
def setConnectionControlsEnabled(self, enabled: bool):
"""Disable connection-sensitive settings during a transition."""
self.tunModeCard.checkBox.setEnabled(bool(enabled) and self._tunModeAvailable)
self.tunModeCard.titleLabel.setEnabled(self.tunModeCard.checkBox.isEnabled())
self.systemProxyCard.comboBox.setEnabled(bool(enabled))
def showEvent(self, event):