[PATCH v3 0/1] MR10017: comctl32 : center icon in LV_VIEW_ICON mode by adjusting icon position calculation.
Fix icon display issue in "Faststone Image Viewer". -- v3: comctl32 : center icon in LV_VIEW_ICON mode by adjusting icon position calculation. https://gitlab.winehq.org/wine/wine/-/merge_requests/10017
From: Maotong Zhang <zmtong1988@gmail.com> Fix icon display issue in "Faststone Image Viewer". --- dlls/comctl32/listview.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index f91e63f1f5b..f87404be924 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -2438,8 +2438,20 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW Icon.right += infoPtr->iconSize.cx; Icon.bottom = Icon.top + infoPtr->iconSize.cy; } - if(lprcIcon) *lprcIcon = Icon; - TRACE(" - icon=%s\n", wine_dbgstr_rect(&Icon)); + if(lprcIcon) + { + if (infoPtr->uView == LV_VIEW_ICON) + { + int cx_margin = GetSystemMetrics(SM_CXBORDER) * Icon.left; + int cy_margin = GetSystemMetrics(SM_CYEDGE); + Icon.left -= cx_margin; + Icon.right += cx_margin; + Icon.top -= cy_margin; + Icon.bottom += cy_margin; + } + *lprcIcon = Icon; + } + TRACE(" - icon=%s\n", wine_dbgstr_rect(&Icon)); /* TODO: is this correct? */ if (lprcStateIcon) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10017
V2:Recalculate the icon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10017#note_129307
participants (2)
-
Maotong Zhang -
Maotong Zhang (@xiaotong)