refactor: styles for library controls popup and filter combobox #211

Manually merged
Boria138 merged 1 commits from Dervart/PortProtonQt:styles into main 2026-06-30 12:52:25 +00:00
7 changed files with 22 additions and 291 deletions

No files matched your search

+3 -3
View File
@@ -71,8 +71,7 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
)
combo.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
combo.addItems(labels)
combo_style = getattr(self.theme, "LIBRARY_FILTER_COMBOBOX_STYLE", self.theme.COMBOBOX_STYLE)
combo.setStyleSheet(combo_style + self.theme.SCROLL_STYLE)
combo.setStyleSheet(self.theme.COMBOBOX_STYLE + self.theme.SCROLL_STYLE)
combo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
self._register_gamepad_tooltip(combo, tooltip)
return combo
@@ -112,8 +111,9 @@ class MainWindowLibraryTabMixin(_MainWindowTypingBase):
def _create_library_controls_widget(self) -> QHBoxLayout:
self.libraryControlsWidget = QWidget(self)
controls_layout = QHBoxLayout(self.libraryControlsWidget)
controls_layout.setContentsMargins(0, 0, 0, 0)
controls_layout.setContentsMargins(5, 5, 5, 5)
controls_layout.setSpacing(10)
self.libraryControlsWidget.setStyleSheet(self.theme.LIBRARY_CONTROL_STYLE)
return controls_layout
def _position_library_controls_widget(self) -> None:
@@ -228,79 +228,6 @@ LIBRARY_CONTROLS_BUTTON_STYLE = f"""
}}
"""
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
QComboBox {{
background: {color_bg};
border: {border_thin} {color_text};
border-radius: {border_radius_small};
padding-left: 12px;
height: 30px;
color: {color_text_dark};
font-family: '{font_family}';
font-size: {font_size_normal};
min-width: 120px;
combobox-popup: 0;
}}
QComboBox:hover, QComboBox:focus {{
background: {color_bg};
border: {border_thin} {color_accent};
}}
QComboBox:on {{
background: {color_bg};
border: {border_thin} {color_accent};
border-bottom-style: none;
border-top-left-radius: {border_radius_small};
border-top-right-radius: {border_radius_small};
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}}
QComboBox::drop-down {{
subcontrol-origin: padding;
subcontrol-position: center right;
border-left: {border_thin} {color_border_faint};
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow {{
image: url(%s);
padding: 12px;
height: 10px;
width: 10px;
}}
QComboBox::down-arrow:on {{
image: url(%s);
padding: 12px;
height: 10px;
width: 10px;
}}
QComboBox QAbstractItemView {{
outline: none;
background: {color_surface};
border: {border_thin} {color_accent};
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: {border_radius_small};
border-bottom-right-radius: {border_radius_small};
}}
QComboBox QAbstractItemView::item {{
padding: 3px 3px 3px 6px;
margin: 1px;
min-height: 24px;
border-radius: {border_radius_small};
color: {color_text_dark};
}}
QComboBox QAbstractItemView::item:hover,
QComboBox QAbstractItemView::item:selected {{
background: {color_accent};
color: {color_text_dark};
}}
""" % (
theme_manager.get_icon("down", current_theme_name, as_path=True),
theme_manager.get_icon("up", current_theme_name, as_path=True),
)
SEARCH_EDIT_STYLE = f"""
QLineEdit {{
background: {color_bg};
-73
View File
@@ -176,79 +176,6 @@ LIBRARY_CONTROLS_BUTTON_STYLE = f"""
}}
"""
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
QComboBox {{
background: {color_surface_elevated};
border: {border_thin} transparent;
border-radius: {border_radius_small};
padding-left: 12px;
height: 30px;
color: {color_text};
font-family: '{font_family}';
font-size: {font_size_normal};
min-width: 120px;
combobox-popup: 0;
}}
QComboBox:hover, QComboBox:focus {{
background: {color_accent};
border: {border_thin} {color_accent};
}}
QComboBox:on {{
background: {color_surface_elevated};
border: {border_thin} {color_accent};
border-bottom-style: none;
border-top-left-radius: {border_radius_small};
border-top-right-radius: {border_radius_small};
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}}
QComboBox::drop-down {{
subcontrol-origin: padding;
subcontrol-position: center right;
border-left: {border_thin} {color_border_faint};
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow {{
image: url(%s);
padding: 12px;
height: 10px;
width: 10px;
}}
QComboBox::down-arrow:on {{
image: url(%s);
padding: 12px;
height: 10px;
width: 10px;
}}
QComboBox QAbstractItemView {{
outline: none;
background: {color_surface};
border: {border_thin} {color_accent};
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: {border_radius_small};
border-bottom-right-radius: {border_radius_small};
}}
QComboBox QAbstractItemView::item {{
padding: 3px 3px 3px 6px;
margin: 1px;
min-height: 24px;
border-radius: {border_radius_small};
color: {color_text};
}}
QComboBox QAbstractItemView::item:hover,
QComboBox QAbstractItemView::item:selected {{
background: {color_accent};
color: {color_text};
}}
""" % (
theme_manager.get_icon("down", current_theme_name, as_path=True),
theme_manager.get_icon("up", current_theme_name, as_path=True),
)
SEARCH_EDIT_STYLE = f"""
QLineEdit {{
background: {color_bg};
+9 -71
View File
@@ -44,6 +44,7 @@ border_radius_card = "20px"
border_radius_badge = "5px"
color_accent = "#70b8ff"
color_bg = "#F8F9FC"
color_bg_darker = "#bfc0c7"
color_surface = "#F0F2F5"
color_surface_elevated = "#E9ECEF"
color_surface_hover = "#DEE2E6"
@@ -595,6 +596,14 @@ LIBRARY_WIDGET_STYLE = f"""
}}
"""
LIBRARY_CONTROL_STYLE = f"""
QWidget {{
background: {color_bg_darker};
border: {border_thin} {color_accent};
border-radius: {border_radius_small};
}}
"""
# CONTAINER_STYLE
CONTAINER_STYLE= """
QWidget {
@@ -1015,77 +1024,6 @@ LIBRARY_CONTROLS_BUTTON_STYLE = f"""
}}
"""
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
QComboBox {{
background: {color_bg};
border: {border_thin} {color_text};
border-radius: {border_radius_small};
padding-left: 12px;
height: 34px;
color: {color_text_dark};
font-family: '{font_family}';
font-size: {font_size_normal};
min-width: 120px;
combobox-popup: 0;
}}
QComboBox:hover,
QComboBox:focus {{
background: {color_bg};
border: {border_thin} {color_accent};
}}
QComboBox:on {{
background: {color_bg};
border: {border_thin} {color_accent};
border-bottom-style: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}}
QComboBox::drop-down {{
subcontrol-origin: padding;
subcontrol-position: center right;
border-left: {border_thin} {color_border_faint};
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow {{
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow:on {{
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox QAbstractItemView {{
outline: none;
background: {color_surface};
border: {border_thin} {color_accent};
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}}
QComboBox QAbstractItemView::item {{
padding: 7px 7px 7px 12px;
margin: 3px;
min-height: 24px;
border-radius: {border_radius_small};
color: {color_text_dark};
}}
QComboBox QAbstractItemView::item:hover,
QComboBox QAbstractItemView::item:selected {{
background: {color_accent};
color: {color_text_dark};
}}
"""
# SEARCH FIELD STYLE
SEARCH_EDIT_STYLE = f"""
QLineEdit {{
@@ -303,6 +303,15 @@ LIBRARY_WIDGET_STYLE = f"""
}}
"""
# LIBRARY_CONTROL_STYLE
LIBRARY_CONTROL_STYLE = f"""
QWidget {{
background: {color_bg_darker};
border: {border_thin} {color_accent};
border-radius: {border_radius_small};
}}
"""
# CONTAINER_STYLE
CONTAINER_STYLE = """
QWidget {
@@ -56,6 +56,7 @@ border_radius_slider_handle = "9px"
# === Core Palette ===
color_accent = "#409EFF"
color_bg = "#282a33"
color_bg_darker = "#22242b"
color_surface = "#3f424d"
color_surface_elevated = "#32343d"
color_surface_hover = "#404554"
@@ -46,77 +46,6 @@ LIBRARY_CONTROLS_BUTTON_STYLE = f"""
}}
"""
LIBRARY_FILTER_COMBOBOX_STYLE = f"""
QComboBox {{
background: {color_detail_overlay};
border: {border_thin} {color_border_input};
border-radius: {border_radius_small};
padding-left: 12px;
height: 34px;
color: {color_text};
font-family: '{font_family}';
font-size: {font_size_normal};
min-width: 120px;
combobox-popup: 0;
}}
QComboBox:hover,
QComboBox:focus {{
background: {color_detail_overlay};
border: {border_thin} {color_accent};
}}
QComboBox:on {{
background: {color_bg};
border: {border_thin} {color_accent};
border-bottom-style: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}}
QComboBox::drop-down {{
subcontrol-origin: padding;
subcontrol-position: center right;
border-left: {border_thin} {color_border_faint};
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow {{
image: url({theme_manager.get_icon("down", current_theme_name, as_path=True)});
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox::down-arrow:on {{
image: url({theme_manager.get_icon("up", current_theme_name, as_path=True)});
padding: 12px;
height: 12px;
width: 12px;
}}
QComboBox QAbstractItemView {{
outline: none;
background: {color_surface};
border: {border_thin} {color_accent};
border-top-style: none;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}}
QComboBox QAbstractItemView::item {{
padding: 7px 7px 7px 12px;
margin: 3px;
min-height: 24px;
border-radius: {border_radius_small};
color: {color_text};
}}
QComboBox QAbstractItemView::item:hover,
QComboBox QAbstractItemView::item:selected {{
background: {color_accent};
color: {color_text};
}}
"""
# MAIN FRAME FOR GAME DETAILS
DETAIL_CONTENT_FRAME_STYLE = f"""
QFrame {{