Fix centering of item label in generic wxListCtrl

The item label was not centered if the icon is wider than the label.
This commit is contained in:
taler21 2024-02-08 08:44:20 +01:00
parent 36583f13e1
commit 82b5f85418
2 changed files with 13 additions and 12 deletions

View file

@ -190,10 +190,11 @@ public:
wxASSERT_MSG( m_rectAll.width <= w,
wxT("width can only be increased") );
int delta = (w - m_rectAll.width) / 2;
m_rectAll.width = w;
m_rectLabel.x += (w - m_rectLabel.width) / 2;
m_rectIcon.x += (w - m_rectIcon.width) / 2;
m_rectHighlight.x += (w - m_rectHighlight.width) / 2;
m_rectLabel.x += delta;
m_rectIcon.x += delta;
m_rectHighlight.x += delta;
}
};