Checkboxes in dark mode are incorrectly notified as buttons for screen readers

13 views
Skip to first unread message

Quentin Cosendey

unread,
Aug 20, 2025, 4:11:36 PMAug 20
to wx-u...@googlegroups.com
Hello,

I have quite a simple and classic dialog box with text fields,
checkboxes and buttons. Everything works as expected as long as the app
is in light or unspecified appearance mode.
However, when the app is in dark mode, checkboxes are notified as
buttons by screen readers (Jaws and NVDA), and their state checked or
unchecked isn't announced. They continue to work properly, i.e. the
state correctly switches when clicking or pressing space, but they keep
being indicated as buttons without state to screen readers, as long as
dark mode is on. So screen reader users can no longer know that these
controls are indeed checkboxes, and if the checkboxes are checked or not.

Am I missing something ? Should I do something special for dark mode ?
Is that a limitation of dark mode ? Or this is just a bug ?

I'm using WXWidgets 3.3.2 developement / master branch, last updated
about 10-15 days ago, on Windows 11.

Everything was fine in v3.2.

I activate dark mode with:
SetAppearance(Appearance::Dark);
in wxApp::OnInit, according to user configuration.

My dialog box is pretty simple, some example code:

ConnectDialog::ConnectDialog (App& app0):
wxDialog(nullptr, wxID_ANY,
U(translate("connTitle")),
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
app(app0)
{
auto usernameLabel = new wxStaticText(this, wxID_ANY,
U(translate("login")));
username = new wxTextCtrl(this, ID_USERNAME, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
auto passwordLabel = new wxStaticText(this, wxID_ANY,
U(translate("password")));
password = new wxTextCtrl(this, ID_PASSWORD, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
rememberMe = new wxCheckBox(this, ID_REMEMBERME,
U(translate("rememberpassword")));
autologin = new wxCheckBox(this, ID_AUTOLOGIN,
U(translate("useAutoLogin")));
auto connectBtn = new wxButton(this, wxID_OK, U(translate("connection")));

...

auto dlgSizer = new wxFlexGridSizer(2, 5, 5);
dlgSizer->Add(usernameLabel, 0);
dlgSizer->Add(username, 0, wxEXPAND);
dlgSizer->Add(passwordLabel, 0);
dlgSizer->Add(password, 0, wxEXPAND);
dlgSizer->Add(new wxStaticText(this, wxID_ANY, wxEmptyString), 0);
dlgSizer->Add(rememberMe, 0, wxEXPAND);
dlgSizer->Add(new wxStaticText(this, wxID_ANY, wxEmptyString), 0);
dlgSizer->Add(autologin, 0, wxEXPAND);
dlgSizer->Add(connectBtn, 0);

...

SetSizerAndFit(dlgSizer);

username->SetFocus();
}


Thank you for your help.

Vadim Zeitlin

unread,
Aug 20, 2025, 4:16:17 PMAug 20
to wx-u...@googlegroups.com
On Wed, 20 Aug 2025 22:11:27 +0200 Quentin Cosendey wrote:

QC> I have quite a simple and classic dialog box with text fields,
QC> checkboxes and buttons. Everything works as expected as long as the app
QC> is in light or unspecified appearance mode.
QC> However, when the app is in dark mode, checkboxes are notified as
QC> buttons by screen readers (Jaws and NVDA), and their state checked or
QC> unchecked isn't announced. They continue to work properly, i.e. the
QC> state correctly switches when clicking or pressing space, but they keep
QC> being indicated as buttons without state to screen readers, as long as
QC> dark mode is on. So screen reader users can no longer know that these
QC> controls are indeed checkboxes, and if the checkboxes are checked or not.
QC>
QC> Am I missing something ? Should I do something special for dark mode ?
QC> Is that a limitation of dark mode ? Or this is just a bug ?

This is clearly a bug but it might be a bug in the screen reader and not
wxWidgets. Checkboxes are buttons in Win32 API (don't ask me why, but push
buttons, radio buttons and check boxes are all just buttons with different
styles there), but the screen reader is supposed to examine their style to
see what kind of button is being used and wxCheckBox uses BS_CHECKBOX in
both light and dark mode, so I have no idea why would it be misdetected
only in the latter.

Please try asking the screen reader developers, I'm ready to make whatever
changes we need to make to help them but I don't know what else do they
need, if the button style is not enough (although, somehow, it clearly is
in light mode).

Good luck,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages