Drop the tick from drop-lists; the row is already tinted
The selected row carries selection-background-color, so a checkmark repeats what the colour says — and in a combo as wide as "VN" it repeated it on top of the letters. A combo's default delegate paints menu-style, which is where the glyph comes from; a plain QStyledItemDelegate paints item-view style, which has none. widen_popup does both jobs now, so it is tidy_popup. check_combo_popup additionally requires the delegate to be the plain one and the stylesheet to still tint the current row — removing the delegate line fails it. 21/21 checkers pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
509ae96854
commit
416d88d72f
@@ -50,6 +50,7 @@ def main() -> int:
|
||||
app.processEvents()
|
||||
|
||||
fails = []
|
||||
from PySide6.QtWidgets import QStyledItemDelegate
|
||||
for name in ("language_combo", "nav_project", "provider_combo"):
|
||||
combo = getattr(win, name, None)
|
||||
if combo is None or not combo.count():
|
||||
@@ -66,6 +67,20 @@ def main() -> int:
|
||||
if have < need:
|
||||
fails.append(f"{name}: popup {have}px, khong du {need}px cho chu + dau tick")
|
||||
|
||||
# No tick: the row is already tinted, and the menu-style delegate that
|
||||
# draws one on macOS covered the two letters it was marking.
|
||||
deleg = combo.itemDelegate()
|
||||
plain = type(deleg) is QStyledItemDelegate
|
||||
print(f"{'':15} delegate={type(deleg).__name__} (khong ve dau tick={plain})")
|
||||
if not plain:
|
||||
fails.append(f"{name}: dung delegate kieu menu — macOS se ve dau tick")
|
||||
|
||||
# ...and the current row must still be obvious without one.
|
||||
view = combo.view()
|
||||
sheet = app.styleSheet()
|
||||
if "selection-background-color" not in sheet:
|
||||
fails.append("popup khong to mau muc dang chon")
|
||||
|
||||
print()
|
||||
for f in fails:
|
||||
print("FAIL " + f)
|
||||
|
||||
Reference in New Issue
Block a user