Disabled wxButtons with bitmaps in dark mode do not have their bitmap grayed out like they do in the light mode. Similar situation is with the wxStaticText too.
Screenshots below show disabled inner buttons (the second one and the penultimate one), and the disabled wxStaticText between them:
Light
ksnip_20250623-191333.png (view on web)
Dark
ksnip_20250623-191300.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Funnily enough, wxStaticText changes it appearance in the widgets sample (use <Ctrl+E> to enable/disable a widget there). but does nothing in a minimal sample, being a child of wxDialog, not sure what makes the difference.
widgets sample
wx-statictext-dark-msw.gif (view on web)
wxWidgets (or is it Windows?) tries to make the button bitmap disabled, but it does not look good.
minimal code
wx-dark-statictext-button.png (view on web)
#include <wx/wx.h> #include <wx/artprov.h> class MyDialog: public wxDialog { public: MyDialog(wxWindow* parent = nullptr) : wxDialog(parent, wxID_ANY, "Test") { wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); const wxBitmap bmp{wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_BUTTON)}; for ( size_t i = 0; i < 2; ++i ) { wxButton* button = new wxButton(this, wxID_ANY); button->SetBitmap(bmp); if ( i % 2 ) button->Disable(); mainSizer->Add(button, wxSizerFlags().Expand().Border()); } for ( size_t i = 0; i < 2; ++i ) { wxStaticText* staticText = new wxStaticText(this, wxID_ANY, "wxStaticText"); if ( i % 2 ) staticText ->Disable(); mainSizer->Add(staticText, wxSizerFlags().Expand().Border()); } SetSizerAndFit(mainSizer); } }; class MyApp : public wxApp { bool OnInit() override { MyDialog().ShowModal(); return false; } }; wxIMPLEMENT_APP(MyApp);
BTW, (undocumented?) wxGenericStaticText does not look good in Windows dark mode:
wx-generic-statictext-dark-msw.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Your example gave me an idea and I've figured out what the button problem is: originally, I've set the image color to wxSystemColour::wxSYS_COLOUR_CAPTIONTEXT which is white on the dark theme -- however wxWidgets itself makes the disabled bitmaps lighter color (like on your screenshot), so that's why it looks like it's not doing anything at all on my screenshot since it made a white image brighter which is not perceptible.
This is how it looks if I don't apply the wxSystemColour::wxSYS_COLOUR_CAPTIONTEXT:
ksnip_20250623-202625.png (view on web)
The black buttons are enabled, and the grayed-out middle buttons now look OK (all are black SVG images -- this time without manually applied color).
On the white theme I don't apply any manual colors, so that's why it looks OK there.
I think it would be better if wxWidgets could apply partial transparency to the disabled bitmaps rather than making them brighter.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #25559 as not planned.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Since it turns out these are actually two separate MSW Dark Mode issues (wxStaticText not disabled, and disabled button bitmaps being lighter in color on MSW which doesn't work well in Dark Mode context), I will close this issue and open two new separate ones with more precise info in them.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #25559 as duplicate.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()