feat: add styling to QCheckBox and overlay buttons

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-06-08 23:25:48 +05:00
parent 68a52d6980
commit b0ec4487ca
3 changed files with 36 additions and 6 deletions

View File

@ -972,7 +972,7 @@ class MainWindow(QMainWindow):
# 5. Fullscreen setting for application
self.fullscreenCheckBox = QCheckBox(_("Launch Application in Fullscreen"))
#self.fullscreenCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE)
self.fullscreenCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE)
self.fullscreenCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
self.fullscreenTitle = QLabel(_("Application Fullscreen Mode:"))
self.fullscreenTitle.setStyleSheet(self.theme.PARAMS_TITLE_STYLE)
@ -984,6 +984,7 @@ class MainWindow(QMainWindow):
# 6. Automatic fullscreen on gamepad connection
self.autoFullscreenGamepadCheckBox = QCheckBox(_("Auto Fullscreen on Gamepad connected"))
self.autoFullscreenGamepadCheckBox.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
self.autoFullscreenGamepadCheckBox.setStyleSheet(self.theme.SETTINGS_CHECKBOX_STYLE)
self.autoFullscreenGamepadTitle = QLabel(_("Auto Fullscreen on Gamepad connected:"))
self.autoFullscreenGamepadTitle.setStyleSheet(self.theme.PARAMS_TITLE_STYLE)
self.autoFullscreenGamepadTitle.setFocusPolicy(Qt.FocusPolicy.NoFocus)

View File

@ -22,35 +22,35 @@ class SystemOverlay(QDialog):
# Reboot button
reboot_button = QPushButton(_("Reboot"))
#reboot_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
reboot_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE)
reboot_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
reboot_button.clicked.connect(self.reboot)
layout.addWidget(reboot_button)
# Shutdown button
shutdown_button = QPushButton(_("Shutdown"))
#shutdown_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
shutdown_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE)
shutdown_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
shutdown_button.clicked.connect(self.shutdown)
layout.addWidget(shutdown_button)
# Suspend button
suspend_button = QPushButton(_("Suspend"))
#suspend_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
suspend_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE)
suspend_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
suspend_button.clicked.connect(self.suspend)
layout.addWidget(suspend_button)
# Exit application button
exit_button = QPushButton(_("Exit Application"))
#exit_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
exit_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE)
exit_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
exit_button.clicked.connect(self.exit_application)
layout.addWidget(exit_button)
# Cancel button
cancel_button = QPushButton(_("Cancel"))
#cancel_button.setStyleSheet(self.theme.ACTION_BUTTON_STYLE)
cancel_button.setStyleSheet(self.theme.OVERLAY_BUTTON_STYLE)
cancel_button.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
cancel_button.clicked.connect(self.reject)
layout.addWidget(cancel_button)

View File

@ -90,6 +90,13 @@ SEARCH_EDIT_STYLE = """
}
"""
SETTINGS_CHECKBOX_STYLE = """
QCheckBox:focus {
border: 2px solid #409EFF;
background: #404554;
}
"""
# ОТКЛЮЧАЕМ РАМКУ У QScrollArea
SCROLL_AREA_STYLE = """
QWidget {
@ -206,6 +213,28 @@ ACTION_BUTTON_STYLE = """
}
"""
# СТИЛЬ КНОПОК ОВЕРЛЕЯ
OVERLAY_BUTTON_STYLE = """
QPushButton {
background: #3f424d;
border: 1px solid rgba(255, 255, 255, 0.20);
border-radius: 10px;
color: #ffffff;
font-size: 16px;
font-family: 'Play';
}
QPushButton:hover {
background: #282a33;
}
QPushButton:pressed {
background: #282a33;
}
QPushButton:focus {
border: 2px solid #409EFF;
background-color: #404554;
}
"""
# ТЕКСТОВЫЕ СТИЛИ: ЗАГОЛОВКИ И ОСНОВНОЙ КОНТЕНТ
TAB_TITLE_STYLE = "font-family: 'Play'; font-size: 24px; color: #ffffff; background-color: none;"
CONTENT_STYLE = """