Commit 326af51e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Fix item focus rectangle to use proper label/selection bounds.

parent 10d51ce8
...@@ -4550,6 +4550,7 @@ static inline BOOL LISTVIEW_FillBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc, con ...@@ -4550,6 +4550,7 @@ static inline BOOL LISTVIEW_FillBkgnd(const LISTVIEW_INFO *infoPtr, HDC hdc, con
static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const NMLVCUSTOMDRAW *nmlvcd, const POINT *pos) static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const NMLVCUSTOMDRAW *nmlvcd, const POINT *pos)
{ {
RECT rcSelect, rcLabel, rcBox, rcStateIcon, rcIcon; RECT rcSelect, rcLabel, rcBox, rcStateIcon, rcIcon;
const RECT *background;
HIMAGELIST himl; HIMAGELIST himl;
UINT format; UINT format;
RECT *focus; RECT *focus;
...@@ -4579,14 +4580,18 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N ...@@ -4579,14 +4580,18 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N
if ( infoPtr->uView == LV_VIEW_ICON || if ( infoPtr->uView == LV_VIEW_ICON ||
(infoPtr->uView == LV_VIEW_DETAILS && (!(item->state & LVIS_SELECTED) || (infoPtr->uView == LV_VIEW_DETAILS && (!(item->state & LVIS_SELECTED) ||
(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)))) (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))))
rcSelect = rcLabel; background = &rcLabel;
else
background = &rcSelect;
if (nmlvcd->clrTextBk != CLR_NONE) if (nmlvcd->clrTextBk != CLR_NONE)
ExtTextOutW(nmlvcd->nmcd.hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, NULL, 0, NULL); ExtTextOutW(nmlvcd->nmcd.hdc, background->left, background->top, ETO_OPAQUE, background, NULL, 0, NULL);
if (item->state & LVIS_FOCUSED) if (item->state & LVIS_FOCUSED)
{ {
if (infoPtr->uView == LV_VIEW_DETAILS && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) if (infoPtr->uView == LV_VIEW_DETAILS)
{
if (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)
{ {
/* we have to update left focus bound too if item isn't in leftmost column /* we have to update left focus bound too if item isn't in leftmost column
and reduce right box bound */ and reduce right box bound */
...@@ -4604,13 +4609,13 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N ...@@ -4604,13 +4609,13 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N
rcSelect.left = LISTVIEW_GetColumnInfo(infoPtr, leftmost)->rcHeader.left + Originx; rcSelect.left = LISTVIEW_GetColumnInfo(infoPtr, leftmost)->rcHeader.left + Originx;
} }
} }
rcSelect.right = rcBox.right; rcSelect.right = rcBox.right;
} }
/* store new focus rectangle */
infoPtr->rcFocus = rcSelect; infoPtr->rcFocus = rcSelect;
} }
else
infoPtr->rcFocus = rcLabel;
}
/* state icons */ /* state icons */
if (infoPtr->himlState && STATEIMAGEINDEX(item->state) && (item->iSubItem == 0)) if (infoPtr->himlState && STATEIMAGEINDEX(item->state) && (item->iSubItem == 0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment