Preserve combo box focus border on hover

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-08-21 15:38:48 +08:00
parent 8c41c64105
commit f8d01633c3
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -395,7 +395,7 @@ def controlStyleSheet(
}}
QComboBox::drop-down {{
subcontrol-origin: border;
subcontrol-origin: padding;
subcontrol-position: top right;
width: 27px;
border: none;
+10
View File
@@ -490,3 +490,13 @@ class StyleSheetCompositionTest(TestCase):
self.assertEqual(stylesheet.count('QToolTip {'), 1)
self.assertEqual(stylesheet.count('QTableView,'), 1)
def testComboBoxDropDownHoverStaysInsideTheFocusBorder(self):
"""Keep the arrow hover fill from covering the outer focus outline."""
for theme in (AppStyleSheet.Light, AppStyleSheet.Dark):
with self.subTest(theme=theme):
stylesheet = AppStyleSheet.forTheme(theme)
dropDownRule = stylesheet.split('QComboBox::drop-down {', 1)[1]
dropDownRule = dropDownRule.split('}', 1)[0]
self.assertIn('subcontrol-origin: padding;', dropDownRule)