Repository navigation
[GUI] Match the Windows checked checkbox blue to MATLAB - #848
arnodelorme wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @arnodelorme's task in 40s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gapsNone. The test uses the real dialog builder and checks the color a user would see, and being Windows-only matches the code path. EEGLAB parity notesNone. The change only affects how the checked box looks, which now matches MATLAB's Windows 11 checkbox (#005fb8 measured in both). Checked for correctness bugs, EEGLAB parity, data structure compatibility, tests for the changed behavior, and CLAUDE.md/AGENTS.md compliance. |
| widget = QtWidgets.QCheckBox(control.string) | ||
| if sys.platform == "win32": | ||
| palette = widget.palette() | ||
| palette.setColor(QtGui.QPalette.ColorRole.Accent, QtGui.QColor("#005fb8")) |
There was a problem hiding this comment.
Nit: #005fb8 is the only color in qt.py that's written inline. Every other EEGLAB color is a named constant in theme.py, like EEGLAB_PROGRESS_CHUNK = "#0078d7". AGENTS.md asks for semantically important magic values to live in top-level constants.
Suggested fix: add EEGLAB_WINDOWS_CHECKED_BLUE = "#005fb8" to src/eegprep/functions/guifunc/theme.py, import it here, and use it in the new test as well. Doing that touches several places, so I didn't attach a suggestion block.
|
Review (Claude Fable): needs more work
Same zoom for the three boxes. EEGLAB and "before" are cut from the Windows 11 captures of Details1. Check mark colour (blocking). Measured on the captures above:
The contrast is the WCAG ratio, computed with white and with The mark has the navy of the label, so it very likely follows the text colour that the shared style sheet gives to
I could not run the 2. Capture (important). Rule 27 asks for EEGLAB, EEGPrep before and EEGPrep after side by side. Arno asked for one capture only, so one image holding the three boxes, as above, meets both. Please replace the image of the body with the new one after the fix, and put the same image in the Word and PDF report, which also shows EEGPrep alone. 3. To check on the guest: a greyed checked box. 4. Nits.
What I checked.
— orchestrator review |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Code reviewIndependent review by Codex (OpenAI, model gpt-6.1-terra), run read-only on commit What was done with its findings (commit
— orchestrator Overall assessmentChanges are needed before merging. The approach is plausible for the normal checked state under Qt 6.11, but it changes the disabled mark and does not produce a white mark under at least one older permitted Qt version. The review is based on checkout BlockingQt 6.10 does not use the overridden mark color. At ImportantThe disabled checked mark changes. The changelog overstates the result. NitsNone. Test gapsThe new test detects the reported dark navy mark if that mark falls within the sampled area, because it lowers the green channel below the asserted threshold. However, The test captures immediately after showing the dialog at What I could not verifyI could not run a Windows 11 rendering test or compare screenshots with MATLAB. Qt 6.11 source indicates that the checked indicator delegates from the style sheet to the native style when its indicator rule has no drawable, then uses The label normally uses The lazy class creation and cache look coherent, and the optional import remains guarded at |
# Conflicts: # src/eegprep/functions/guifunc/qt.py # src/eegprep/functions/guifunc/theme.py
arnodelorme
left a comment
There was a problem hiding this comment.
This review was written by an AI assistant during a nightly check, not by Arno.
Code review
- Overall assessment: The code change is ready, pending the updated Windows 11 comparison capture noted in the description.
- Highest-risk area: Palette role overrides on
QStyleOptionButtoninWindowsCheckBox.initStyleOption(src/eegprep/functions/guifunc/qt.py) across Qt 6.7 through 6.11. - Merge recommendation: Safe to merge once the Windows 11 capture of the current head (
7adb1ad3e2b7ecd3323cfeceacc43d939f518be5) is attached.
Blocking
None.
Important
- Missing Windows 11 comparison capture for the current head (pull request description and
AGENTS.mdGUI comparison requirement): The attached comparison image and linked reports still show the earlier head with the navy check mark (2.8 to 1 contrast) rather than7adb1ad3e2b7ecd3323cfeceacc43d939f518be5. Capture the current head on Windows 11 and update the side by side image next to MATLAB before merging.
Nits
None.
Test gaps
- Checked checkbox label color on Windows 11 (
tests/test_guifunc_primitives.py, lines 306 to 333):_sample_checked_boxbuildsControlSpec("checkbox", tag="box", value=True)with an empty label string, so the Windows test verifies the indicator fill and mark contrast but never checks that the label text stays navy (#000066). BecauseQCheckBox::paintEventpasses the sameQStyleOptionButtontoCE_CheckBoxfor both the indicator andCE_CheckBoxLabel(Qt 6qcheckbox.cpp, primary upstream source, credibility 10/10), giving the test control a non empty label and asserting thatSE_CheckBoxContentsstill contains#000066(and not#ffffff) would guard against any style path readingButtonTextfor the label.
EEGLAB parity notes
- EEGLAB's
supergui.m(primary upstream source, credibility 10/10) delegates checkbox indicator drawing to MATLAB on Windows, which renders a white mark on#005fb8(WCAG 2.1 contrast ratio 6.3 to 1, W3C Recommendation, credibility 10/10). ScopingWindowsCheckBoxtosys.platform == "win32"inQtDialogRenderer._build_widget(src/eegprep/functions/guifunc/qt.py, line 448) leaves macOS and Linux unchanged while matching MATLAB on Windows 11 across Qt 6.7 through 6.11 (qwindows11style.cpp, primary upstream source, credibility 10/10).
Verification and tests run
- Ran
PYTHONPATH=<worktree>/src .venv/bin/python -m pytest <worktree>/tests/test_guifunc_primitives.pyin a detached worktree at7adb1ad3e2b7ecd3323cfeceacc43d939f518be5on macOS: 17 passed, 1 skipped (the Windows native checkbox test), 1 deselected reference test. - Ran
.venv/bin/ruff checkand.venv/bin/ruff format --checkonsrc/eegprep/functions/guifunc/qt.py,src/eegprep/functions/guifunc/theme.py, andtests/test_guifunc_primitives.py: all passed. - Checked the completed
Test Python 3.12 on windows-latestCI job (142479927433, PySide6 6.11.0) on this pull request:tests/test_guifunc_primitives.pypassed all 17 tests with 0 skipped, confirmingtest_windows_checked_box_is_the_matlab_blue_with_a_white_markran on thewindowsplatform plugin with thewindows11style. (The 3 failures in that job are intests/test_gui_pop_erpimage.pyandtests/test_stream11_datasets.py, which come fromdevelop.)
Checked for correctness bugs, optional PySide6 import guards, stylesheet and supergui layout interactions, EEGLAB parity, changed behavior tests, and CLAUDE.md and AGENTS.md compliance.
|
🤖 Second round (commit
|

A checked box in a Windows dialog is now drawn as MATLAB draws it: a white check mark on the dark blue #005fb8. The earlier version of this branch had the right blue but kept the navy mark of the label (2.8 to 1 contrast). The mark is now white (6.3 to 1, as in MATLAB). The native Windows 11 style still draws the box, the mark, the border and the focus state.
Left to right, from Windows 11 captures at the same zoom: EEGLAB in MATLAB, EEGPrep before this pull request, and EEGPrep at the earlier head of this branch (navy mark). The capture of the new head with the white mark on Windows is not in this picture yet: it has to be taken on the Windows 11 guest. Until then the evidence for the white mark is the Windows test below and the Qt source.
Editable Word report · PDF report (both still show the earlier head)
Cause and change
Qt's Windows 11 style fills a checked box with the
Accentcolour of the palette and, from Qt 6.11, draws the mark withButtonTextwhen that role is set (QWindows11Style::controlTextColor), and in white otherwise. The dialog style sheet givesQCheckBoxthe navy text colour, which also setsButtonText, so the mark came out navy. The shared checkbox builder now uses, on Windows only, aQCheckBoxwhose style option carries the two colours of the box:Accent#005fb8 andButtonTextwhite. The label does not read that option, so it stays navy. Unchecked and greyed boxes, macOS and Linux do not change. The two colours are constants inguifunc/theme.py.Verification
The CI jobs of the new head were still queued when this was written, so the Windows result of the new test is not known yet. The Windows test builds a dialog with the Windows 11 style, grabs the checked box and checks its pixels: the exact fill #005fb8 is present, no pixel inside the box is darker than the fill (a navy mark would be), and the mark is at least half way to white. On the Mac,
tests/test_guifunc_primitives.pygives 10 passed and 1 skipped (the Windows test). Ruff passed. No numerical code changes, so no EEGLAB parity run is needed.Fixes #811
Part of #745