Make default wxSizer border DPI-aware.

Scale the (still hard-coded) border in pixels by the content scale factor for
the platforms where this needs to be done, i.e. not wxGTK nor wxOSX where the
underlying toolkit already does it.
This commit is contained in:
Vadim Zeitlin
2015-03-24 23:39:40 +01:00
parent 277b848364
commit af01ef1bb0
4 changed files with 57 additions and 3 deletions

View File

@@ -1372,6 +1372,10 @@ public:
/**
Sets the wxSizerFlags to have a border of a number of pixels specified
by @a borderinpixels with the directions specified by @a direction.
Prefer to use the overload below or DoubleBorder() or TripleBorder()
versions instead of hard-coding the border value in pixels to avoid too
small borders on devices with high DPI displays.
*/
wxSizerFlags& Border(int direction, int borderinpixels);
@@ -1478,6 +1482,10 @@ public:
/**
Returns the border used by default in Border() method.
This value is scaled appropriately for the current DPI on the systems
where physical pixel values are used for the control positions and
sizes, i.e. not with wxGTK or wxOSX.
*/
static int GetDefaultBorder();