mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Define styling for QComboBox and QLineEdit globally
This commit is contained in:
parent
dfe06c0643
commit
bcf8992a9d
2 changed files with 30 additions and 1 deletions
|
@ -33,6 +33,9 @@ copy_mdi_icons(
|
||||||
# tags
|
# tags
|
||||||
"tag-outline.svg",
|
"tag-outline.svg",
|
||||||
"tag-off-outline.svg",
|
"tag-off-outline.svg",
|
||||||
|
|
||||||
|
# QComboBox arrow
|
||||||
|
"chevron-down.svg",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,33 @@ class ThemeManager:
|
||||||
gui_hooks.theme_did_change()
|
gui_hooks.theme_did_change()
|
||||||
|
|
||||||
def _apply_style(self, app: QApplication) -> None:
|
def _apply_style(self, app: QApplication) -> None:
|
||||||
buf = ""
|
buf = f"""
|
||||||
|
QComboBox,
|
||||||
|
QLineEdit {{
|
||||||
|
border: 1px solid {self.color(colors.BORDER)};
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 2px;
|
||||||
|
}}
|
||||||
|
QComboBox:focus,
|
||||||
|
QLineEdit:focus {{
|
||||||
|
border: 1px solid {self.color(colors.FOCUS_BORDER)};
|
||||||
|
}}
|
||||||
|
QComboBox:on {{
|
||||||
|
border-bottom: none;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}}
|
||||||
|
QComboBox::drop-down {{
|
||||||
|
border: 0px; /* This resets the arrow styles */
|
||||||
|
subcontrol-origin: padding;
|
||||||
|
padding: 4px;
|
||||||
|
subcontrol-position: top right;
|
||||||
|
width: 18px;
|
||||||
|
}}
|
||||||
|
QComboBox::down-arrow {{
|
||||||
|
image: url(icons:chevron-down.svg);
|
||||||
|
}}
|
||||||
|
"""
|
||||||
|
|
||||||
if is_win and platform.release() == "10":
|
if is_win and platform.release() == "10":
|
||||||
# day mode is missing a bottom border; background must be
|
# day mode is missing a bottom border; background must be
|
||||||
|
|
Loading…
Reference in a new issue