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