From b63e89db9233b48b21e3b4c521d2421509271606 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 15 Apr 2019 18:31:02 +0200 Subject: [PATCH] Simplify calculation of wxPropertyGrid header position We can just query the grid its for actual border width instead of calculating it on our own. --- src/propgrid/manager.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index fa5b37792a..7faa43fc6c 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -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;