Simplify calculation of wxPropertyGrid header position

We can just query the grid its for actual border width instead of
calculating it on our own.
This commit is contained in:
Artur Wieczorek
2019-04-15 18:31:02 +02:00
parent 6cc1d63d68
commit b63e89db92

View File

@@ -301,11 +301,8 @@ private:
{
wxPropertyGrid* pg = m_manager->GetGrid();
int sbWidth = pg->HasScrollbar(wxSB_VERTICAL)
? wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, pg)
: 0;
// Internal border width
int borderWidth = (pg->GetSize().x - pg->GetClientSize().x - sbWidth) / 2;
int borderWidth = pg->DoGetBorderSize().x / 2;
const unsigned int colCount = m_page->GetColumnCount();
for ( unsigned int i = 0; i < colCount; i++ )
@@ -340,11 +337,8 @@ private:
{
wxPropertyGrid* pg = m_manager->GetGrid();
int sbWidth = pg->HasScrollbar(wxSB_VERTICAL)
? wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, pg)
: 0;
// Internal border width
int borderWidth = (pg->GetSize().x - pg->GetClientSize().x - sbWidth) / 2;
int borderWidth = pg->DoGetBorderSize().x / 2;
// Compensate for the internal border
int x = -borderWidth;