From 9dd88e0159901c549e037bc0e8b75b79fb90cbe4 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Sat, 13 Feb 2021 13:56:54 +0100 Subject: [PATCH] Undo removal of text alignment for wxDataViewCtrl's RenderText() Revert e2e7d3d391 (Fix wxELLIPSIZE_END with wxALIGN_RIGHT in wxMSW wxDataViewCtrl, 2016-03-18). This fix is no longer needed after the previous commit reverted b642747fd2. Reverting also allows for text to be drawn vertically aligned again instead of always using top-left alignment. While the difference in appearance by not having alignment can be minor with default row heights, it becomes more noticeable with taller rows: a wxDataViewCheckIconText column with a tall icon will have its text stuck to the top of a row while other columns have their text vertically centered. This already occurs by default when not explicitly specifying an alignment (wxDVR_DEFAULT_ALIGNMENT) which results in wxALIGN_CENTRE_VERTICAL being used for row alignment when rendering. --- src/common/datavcmn.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 715bfc08cc..7d25c8fe2b 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1090,17 +1090,12 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, if ( !(GetOwner()->GetOwner()->IsEnabled() && GetEnabled()) ) flags |= wxCONTROL_DISABLED; - // Notice that we intentionally don't use any alignment here: it is not - // necessary because the cell rectangle had been already adjusted to - // account for the alignment in WXCallRender() and using the alignment here - // results in problems with ellipsization when using native MSW renderer, - // see https://trac.wxwidgets.org/ticket/17363, so just don't do it. wxRendererNative::Get().DrawItemText( GetOwner()->GetOwner(), *dc, text, rectText, - wxALIGN_NOT, + GetEffectiveAlignment(), flags, GetEllipsizeMode()); }