At high DPI, the check box of a wxBoolProperty
is not vertically centered unless the property is the selected one.
So the vertical position of the check box differs depending on whether the wxBoolProperty
is selected in the wxPropertyGrid
or not.
The issue can also be seen in the propgrid sample.
wxBoolProperty-check-box-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.
Something like this (on top of #24671) seems to be working:
diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 9dfc565e5f..da6d2e93c1 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1555,7 +1555,7 @@ public: // Due to SetOwnFont stuff necessary for GTK+ 1.2, we need to have this wxControl::SetFont( parent->GetFont() ); - SetBoxHeight(12); + SetBoxHeight(13); wxControl::SetBackgroundStyle( wxBG_STYLE_PAINT ); } @@ -1565,10 +1565,7 @@ public: { m_boxHeight = height; // Box rectangle - wxRect rect(GetClientSize()); - rect.y += 1; - rect.width += 1; - m_boxRect = GetBoxRect(rect, m_boxHeight); + m_boxRect = GetBoxRect(GetClientSize(), m_boxHeight); } static wxRect GetBoxRect(const wxRect& r, int box_h) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 41b45f8f4d..f9166b9681 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -86,7 +86,7 @@ void wxPGCellRenderer::DrawEditorValue( wxDC& dc, const wxRect& rect, { wxRect rect2(rect); rect2.Offset(xOffset, yOffset); - rect2.height -= yOffset; + rect2.height -= yOffset * 2; editor->DrawValue( dc, rect2, property, text ); } else
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Yes, with these changes it works correctly. Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.