CrowdAnki icon indicating copy to clipboard operation
CrowdAnki copied to clipboard

Improve visibility of personal fields checkboxes in dark mode

Open aplaice opened this issue 9 months ago • 1 comments

See https://github.com/Stvad/CrowdAnki/issues/223#issuecomment-2783706169

Also, possibly we should make clicking the field name (and not just the checkbox itself) also toggle the checkbox (currently clicking the field name just highlights the field with no effect, and no ability to copy the text, so I don't think we'd lose anything).

I think this should be straightforward...

Image

aplaice avatar Apr 07 '25 19:04 aplaice

After some investigation, I'm not sure if we should mess with the CSS/QSS of the widgets.

Detecting Anki dark mode and modifying the colour of the checkboxes could be done straightforwardly (at least, in a hacky way; in a non-hacky way it'd require more effort since we'd likely need our own theming module which would work along the lines of Anki's stylesheets.py, though we'd have to take care not to override Anki's own styles; for the purpose of colouring one set of checkboxes this would clearly be a massive overkill, though).

The reasons why I'm not sure if we want to adjust the colours:

  1. In light mode, the contrast isn't much better. (Without explicitly carrying out the contrast calculations, I can't tell by how much, though.)

    I think that the main difference between light and dark mode is because in light mode, all the backgrounds are the same near-white colour, while in dark mode the background of QListWidget is a darker gray than the rest, which means that the checkboxes which have adequate(-ish) contrast when they're QCheckBoxs (which Anki has quite a large number of — e.g. in settings), no longer have a good-enough contrast when they're QListWidgetItems (which Anki has few of).

Image

  1. Anki's own QListWidgetItem checkboxes have the same styling (as should be the case...), and changing the behaviour only for us would be inconsistent.

Image

  1. Given 2, if somebody uses a theming add-on, that changes the background of QListWidgets, then our modifying just the checkbox colour might result in weirdness (depending on precedence rules).

The correct thing to do would probably be to change the colour upstream, in Anki, but I'm not sure if they'd take the patch given how few places the QListWidgetItems are used in.

aplaice avatar Apr 18 '25 08:04 aplaice