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) ...@@ -325,9 +325,13 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
rcArrow.left = rc.right; rcArrow.left = rc.right;
} }
/* Take the border into account and center the bitmap horizontally */ /* Center the bitmap horizontally and vertically */
rcBitmap.left+=(infoPtr->nButtonWidth - infoPtr->nBitmapWidth - 1-2) / 2; rcBitmap.left+=(infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2;
rcBitmap.top+=1;
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); TRACE("iBitmap: %d\n", btnPtr->iBitmap);
...@@ -449,10 +453,10 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) ...@@ -449,10 +453,10 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc)
if (btnPtr->bHot && infoPtr->himlHot && if (btnPtr->bHot && infoPtr->himlHot &&
TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap))
ImageList_Draw (infoPtr->himlHot, btnPtr->iBitmap, hdc, 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)) else if (TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap))
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc, ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
rcBitmap.left + 1, rcBitmap.top + 1, ILD_NORMAL); rcBitmap.left, rcBitmap.top, ILD_NORMAL);
} }
else 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