As can be seen in the propgrid sample, the check mark of a wxBoolProperty
looks sharp at 100% DPI scaling but blurry at 200% and 300%.
wxBoolProperty-check-mark-100-200-300-DPI-scaling.png (view on web)
The check mark of a wxCheckBox
looks sharp even at 300% DPI scaling.
wxCheckBox-check-mark-300-DPI-scaling.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.
I haven't looked yet, but could there be some downscaling happening?
In that case, #24567 should help.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
The actual drawn checkbox size is different to the rect that wx passes to DrawThemeBackground
.
DrawThemeBackground | Actual | Scale |
---|---|---|
15x15 | 13x13 | 100% |
20x20 | 16x16 (if DPI changed from 100%) | 125% |
20x20 | 20x20 (if DPI didn't change) | 125% |
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Here are best checkbox sizes for different scales on Win11:
100%: 13
125%: 16
150%: 20
175%: 20
200%: 26
225%: 26
250%: 32
300%: 40
350%: 40
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Seems to be working correctly with this patch:
diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 2a8d013b31..31e884142f 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -716,7 +716,18 @@ wxRendererXP::DoDrawXPButton(int kind, if ( !hTheme ) return false; - DoDrawButtonLike(hTheme, kind, dc, rect, flags); + wxRect crect = rect; + + if ( kind == BP_CHECKBOX ) + { + if ( ::IsThemePartDefined(hTheme, kind, 0) ) + { + crect = wxRect(hTheme.GetDrawSize(kind, CBS_UNCHECKEDNORMAL)); + crect.MakeCenteredIn(rect); + } + } + + DoDrawButtonLike(hTheme, kind, dc, crect, flags); return true; }
Maybe makes sense to apply to BP_RADIOBUTTON
as well.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Thanks for looking at this.
I can confirm that with your changes applied, it looks correct.
wxBoolProperty-check-mark-patched.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.
PR: #24671
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.