comctl32: CCS_VERT flips toolbar separators' orientation
Igor Tarasov
tarasov.igor at gmail.com
Tue Mar 17 18:20:12 CDT 2009
Currently wine flips orientation of toolbar separators on
BTNS_DROPDOWN, which is odd, since even horizontal toolbar separators
may have this flag turned on. Tests with control spy show that native
comctl flips orientation on CCS_VERT toolbar style, which is logical.
This patch fixes this, thus fixing bug 13257:
http://bugs.winehq.org/show_bug.cgi?id=13257
--
Igor
-------------- next part --------------
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 5ef701d..8635ff5 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -494,7 +494,7 @@ TOOLBAR_DrawFlatSeparator (const RECT *lpRect, HDC hdc, const TOOLBAR_INFO *i
/***********************************************************************
* TOOLBAR_DrawDDFlatSeparator
*
-* This function draws horizontal separator for toolbars having style CCS_VERT.
+* This function draws separator for vertical toolbars (with CCS_VERT style).
* In this case, the separator is a pixel high line of COLOR_BTNSHADOW,
* followed by a pixel high line of COLOR_BTNHIGHLIGHT. These separators
* are horizontal as opposed to the vertical separators for not dropdown
@@ -845,7 +845,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCus
if (theme)
{
DrawThemeBackground (theme, hdc,
- (dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
+ (infoPtr->dwStyle & CCS_VERT) ? TP_SEPARATORVERT : TP_SEPARATOR, 0,
&rc, NULL);
}
else
@@ -855,7 +855,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCus
/* empirical tests show that iBitmap can/will be non-zero */
/* when drawing the vertical bar... */
if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) {
- if (btnPtr->fsStyle & BTNS_DROPDOWN)
+ if (dwStyle & CCS_VERT)
TOOLBAR_DrawDDFlatSeparator (&rc, hdc, infoPtr);
else
TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr);
@@ -1330,10 +1330,9 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle )
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
/* */
- /* BTNS_DROPDOWN separators are treated as buttons for */
- /* width. - GA 8/01 */
+ /* horizontal separators are treated as buttons for width */
if ((btnPtr[i].fsStyle & BTNS_SEP) &&
- !(btnPtr[i].fsStyle & BTNS_DROPDOWN))
+ !(infoPtr->dwStyle & CCS_VERT))
cx = (btnPtr[i].iBitmap > 0) ?
btnPtr[i].iBitmap : SEPARATOR_WIDTH;
else
@@ -1689,7 +1688,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd)
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
if (btnPtr->fsStyle & BTNS_SEP) {
- if (btnPtr->fsStyle & BTNS_DROPDOWN) {
+ if (infoPtr->dwStyle & CCS_VERT) {
cy = (btnPtr->iBitmap > 0) ?
btnPtr->iBitmap : SEPARATOR_WIDTH;
cx = infoPtr->nButtonWidth;
More information about the wine-patches
mailing list