Mikołaj Zalewski : comctl32: toolbar: The SetButtonSize should not allow too small buttons.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Nov 2 05:46:51 CST 2006
Module: wine
Branch: master
Commit: 420f7cb076dde39941ccd46ef3a6e12a5e6efb3a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=420f7cb076dde39941ccd46ef3a6e12a5e6efb3a
Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date: Wed Nov 1 23:04:05 2006 +0100
comctl32: toolbar: The SetButtonSize should not allow too small buttons.
---
dlls/comctl32/toolbar.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index dd63e1c..42ec39e 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -4646,8 +4646,17 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM
* either size, the system changes it to the default of 24 wide and
* 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02
*/
- infoPtr->nButtonWidth = (cx) ? cx : 24;
- infoPtr->nButtonHeight = (cy) ? cy : 22;
+ if (cx == 0) cx = 24;
+ if (cy == 0) cx = 22;
+
+ cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
+ cy = max(cy, infoPtr->szPadding.cy + infoPtr->nVBitmapHeight);
+
+ infoPtr->nButtonWidth = cx;
+ infoPtr->nButtonHeight = cy;
+
+ infoPtr->iTopMargin = default_top_margin(infoPtr);
+ TOOLBAR_LayoutToolbar(hwnd);
return TRUE;
}
More information about the wine-cvs
mailing list