comctl32: A couple fixes for tab icon offsets.

- Shift selected icons up and non-selected icons down.
- Add the top or left draw rect to the vertical offset, because it may
  not be zero.
This commit is contained in:
James Hawkins 2006-03-23 00:07:10 -06:00 committed by Alexandre Julliard
parent bed3d4d3eb
commit aa57ad373d
1 changed files with 8 additions and 2 deletions

View File

@ -1747,14 +1747,20 @@ TAB_DrawItemInterior
if(lStyle & TCS_VERTICAL)
{
center_offset_h = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2;
center_offset_v = ((drawRect->right - drawRect->left) - (cx + infoPtr->uVItemPadding)) / 2;
center_offset_v = (drawRect->left + (drawRect->right - drawRect->left) - cx) / 2;
}
else
{
center_offset_h = ((drawRect->right - drawRect->left) - (cx + infoPtr->uHItemPadding + (rcText.right - rcText.left))) / 2;
center_offset_v = ((drawRect->bottom - drawRect->top) - (cy + infoPtr->uVItemPadding)) / 2;
center_offset_v = (drawRect->top + (drawRect->bottom - drawRect->top) - cy) / 2;
}
/* if an item is selected, the icon is shifted up instead of down */
if (iItem == infoPtr->iSelected)
center_offset_v -= infoPtr->uVItemPadding / 2;
else
center_offset_v += infoPtr->uVItemPadding / 2;
if (lStyle & TCS_FIXEDWIDTH && lStyle & (TCS_FORCELABELLEFT | TCS_FORCEICONLEFT))
center_offset_h = infoPtr->uHItemPadding;