Adjust wxMSW wxStaticBox pixel constants for DPI

Use FromDIP() with all constants expressed in pixels, this should result
in better appearance when using high DPI.
This commit is contained in:
Vadim Zeitlin
2017-12-20 23:01:11 +01:00
parent 23a830ae16
commit dfba063d53

View File

@@ -460,15 +460,15 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT&)
// first we need to correctly paint the background of the label
// as Windows ignores the brush offset when doing it
const int x = LABEL_HORZ_OFFSET;
const int x = FromDIP(LABEL_HORZ_OFFSET);
RECT dimensions = { x, 0, 0, height };
dimensions.left = x;
dimensions.right = x + width;
// need to adjust the rectangle to cover all the label background
dimensions.left -= LABEL_HORZ_BORDER;
dimensions.right += LABEL_HORZ_BORDER;
dimensions.bottom += LABEL_VERT_BORDER;
dimensions.left -= FromDIP(LABEL_HORZ_BORDER);
dimensions.right += FromDIP(LABEL_HORZ_BORDER);
dimensions.bottom += FromDIP(LABEL_VERT_BORDER);
if ( UseBgCol() )
{