Fix wxCheckListBox checkbox rendering under RTL
When running under a RTL locale, checkboxes should not be mirrored, but should keep the same appearence in both RTL and LTR layouts.
This commit is contained in:
@@ -157,7 +157,14 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
|||||||
int y = rc.GetY() + (rc.GetHeight() - size.GetHeight()) / 2;
|
int y = rc.GetY() + (rc.GetHeight() - size.GetHeight()) / 2;
|
||||||
|
|
||||||
UINT uState = stat & wxOwnerDrawn::wxODSelected ? wxDSB_SELECTED : wxDSB_NORMAL;
|
UINT uState = stat & wxOwnerDrawn::wxODSelected ? wxDSB_SELECTED : wxDSB_NORMAL;
|
||||||
|
|
||||||
|
// checkmarks should not be mirrored in RTL layout
|
||||||
|
DWORD oldLayout = ::GetLayout(hdc);
|
||||||
|
if ( oldLayout & LAYOUT_RTL )
|
||||||
|
::SetLayout(hdc, oldLayout | LAYOUT_BITMAPORIENTATIONPRESERVED);
|
||||||
wxDrawStateBitmap(hdc, hBmpCheck, x, y, uState);
|
wxDrawStateBitmap(hdc, hBmpCheck, x, y, uState);
|
||||||
|
if ( oldLayout & LAYOUT_RTL )
|
||||||
|
::SetLayout(hdc, oldLayout);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user