Skip to content

Commit

Permalink
[win32] fix getting checkbox size from OS
Browse files Browse the repository at this point in the history
This commit fixes fetching the checkbox size for custom drawn checkbox buttons. Instead of using the zoom adjusted by the swt.autoScale setting the native zoom is used. This is neccessary, because the checkbox will be drawn by the OS and therefore is matching the native zoom as well.

Fixes #1573
  • Loading branch information
akoch-yatta committed Nov 6, 2024
1 parent df66a8b commit 3e04710
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ private int getCheckboxTextOffset(long hdc) {
SIZE size = new SIZE();

if (OS.IsAppThemed ()) {
OS.GetThemePartSize(display.hButtonTheme(getZoom()), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
OS.GetThemePartSize(display.hButtonTheme(nativeZoom), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
result += size.cx;
} else {
result += DPIUtil.scaleUp(13, nativeZoom);
Expand Down

0 comments on commit 3e04710

Please sign in to comment.