Commit 4a49c8f0 authored by Chris Morgan's avatar Chris Morgan Committed by Alexandre Julliard

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.
parent 3bd7f587
......@@ -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
{
......
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