From da5db6c5f698e4f1301b62d53ae02956d7140d73 Mon Sep 17 00:00:00 2001 From: awsms <48278661+awsms@users.noreply.github.com> Date: Mon, 22 Jun 2026 02:30:03 +0200 Subject: [PATCH] fix(gui): show checked state in settings menu --- normcap/gui/menu_button.py | 15 ++++++++++++--- tests/tests_gui/test_menu_button.py | 7 +++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/normcap/gui/menu_button.py b/normcap/gui/menu_button.py index 94df349fe..b62b41534 100644 --- a/normcap/gui/menu_button.py +++ b/normcap/gui/menu_button.py @@ -29,9 +29,8 @@ ) } QMenu::item { - padding: 3px 16px 3px 16px; + padding: 3px 22px 3px 28px; background-color: transparent; - right: 10px; color: white; } QMenu::item:disabled { @@ -41,7 +40,17 @@ background-color: rgba(150,150,150,0.5); } QMenu::indicator { - right: -5px; + width: 11px; + height: 11px; + left: 8px; +} +QMenu::indicator:unchecked { + border: 1px solid rgba(255,255,255,0.6); + background-color: transparent; +} +QMenu::indicator:checked { + border: 1px solid $COLOR; + background-color: $COLOR; } QMenu::left-arrow, QMenu::right-arrow { diff --git a/tests/tests_gui/test_menu_button.py b/tests/tests_gui/test_menu_button.py index 7d8e98d41..3bd49e360 100644 --- a/tests/tests_gui/test_menu_button.py +++ b/tests/tests_gui/test_menu_button.py @@ -131,6 +131,13 @@ def test_settings_group(menu_btn): assert setting_value == action.isChecked() +def test_menu_has_visible_check_indicators(menu_btn): + stylesheet = menu_btn.menu().styleSheet() + + assert "QMenu::indicator:checked" in stylesheet + assert "QMenu::indicator:unchecked" in stylesheet + + def test_show_message_box(qapp, monkeypatch, menu_btn): # GIVEN a menu button and a mocked QMessageBox.exec() method exec_args = []