Fix depressed state with flat toolbars so pressing the buttons draws

the button in a depressed state.  Fix bitmap offsets, fixes bitmap
offset problems in file common dialog.
oldstable
Chris Morgan 2000-10-12 23:11:35 +00:00 committed by Alexandre Julliard
parent 3bd7f58706
commit 4a49c8f080
1 changed files with 10 additions and 6 deletions

View File

@ -325,9 +325,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
rcArrow.left = rc.right;
}
/* Take the border into account and center the bitmap horizontally */
rcBitmap.left+=(infoPtr->nButtonWidth - infoPtr->nBitmapWidth - 1-2) / 2;
rcBitmap.top+=1;
/* Center the bitmap horizontally and vertically */
rcBitmap.left+=(infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2;
if(TOOLBAR_HasText(infoPtr, btnPtr))
rcBitmap.top+=2; /* this looks to be the correct value from vmware comparison - cmm */
else
rcBitmap.top+=(infoPtr->nButtonHeight - infoPtr->nBitmapHeight) / 2;
TRACE("iBitmap: %d\n", btnPtr->iBitmap);
@ -446,13 +450,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if (hasDropDownArrow)
TOOLBAR_DrawArrow(hdc, rcArrow.left+1, rcArrow.top, COLOR_WINDOWFRAME);
if (btnPtr->bHot && infoPtr->himlHot &&
if (btnPtr->bHot && infoPtr->himlHot &&
TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap))
ImageList_Draw (infoPtr->himlHot, btnPtr->iBitmap, hdc,
rcBitmap.left + 1, rcBitmap.top + 1, ILD_NORMAL);
rcBitmap.left, rcBitmap.top, ILD_NORMAL);
else if (TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap))
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
rcBitmap.left + 1, rcBitmap.top + 1, ILD_NORMAL);
rcBitmap.left, rcBitmap.top, ILD_NORMAL);
}
else
{