Fix misaligned icons in wxTreeCtrl for wxQt
Center the items vertically, as this looks much better, and is also more consistent with the appearance in the generic version, which was previously used. Closes https://github.com/wxWidgets/wxWidgets/pull/1378
This commit is contained in:
committed by
Vadim Zeitlin
parent
81c31c6094
commit
25c9bf9664
@@ -222,7 +222,8 @@ protected:
|
||||
const wxImageList *imageList = GetHandler()->GetImageList();
|
||||
const wxBitmap bitmap = imageList->GetBitmap(imageIndex);
|
||||
const QRect rect = visualRect(index);
|
||||
painter->drawPixmap(rect.topLeft(), *bitmap.GetHandle());
|
||||
const int offset = (rect.height() / 2) - (bitmap.GetHeight() / 2);
|
||||
painter->drawPixmap(rect.topLeft() + QPoint(0,offset), *bitmap.GetHandle());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user