#ifdef __REACTOS__
SIZE szBarPadding; /* padding values around the toolbar (NOT USED BUT STORED) */
SIZE szSpacing; /* spacing values between buttons */
+ MARGINS themeMargins;
#endif
INT iTopMargin; /* the top margin */
INT iListGap; /* default gap between text and image for toolbar with list style */
max(2*GetSystemMetrics(SM_CXEDGE) + sizeString.cx, infoPtr->nBitmapWidth);
}
}
+
+#ifdef __REACTOS__
+ sizeButton.cx += infoPtr->themeMargins.cxLeftWidth + infoPtr->themeMargins.cxRightWidth;
+ sizeButton.cy += infoPtr->themeMargins.cyTopHeight + infoPtr->themeMargins.cyBottomHeight;
+#endif
+
return sizeButton;
}
SendMessageW (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
-#ifdef __REACTOS__
-static LRESULT
-TOOLBAR_ThemeChanged(HWND hwnd)
-{
- HTHEME theme = GetWindowTheme(hwnd);
- CloseThemeData(theme);
- OpenThemeData(hwnd, themeClass);
- return 0;
-}
-#endif
static void
TOOLBAR_TooltipAddTool(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *button)
if (cx == 0) cx = 24;
if (cy == 0) cy = 22;
+#ifdef __REACTOS__
+ cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth + infoPtr->themeMargins.cxLeftWidth + infoPtr->themeMargins.cxRightWidth);
+ cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight + infoPtr->themeMargins.cyTopHeight + infoPtr->themeMargins.cyBottomHeight);
+#else
cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight);
+#endif
if (cx != infoPtr->nButtonWidth || cy != infoPtr->nButtonHeight ||
top != infoPtr->iTopMargin)
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont);
-
+
+#ifdef __REACTOS__
+ {
+ HTHEME theme = OpenThemeData (hwnd, themeClass);
+ if (theme)
+ GetThemeMargins(theme, NULL, TP_BUTTON, TS_NORMAL, TMT_CONTENTMARGINS, NULL, &infoPtr->themeMargins);
+ }
+#else
OpenThemeData (hwnd, themeClass);
+#endif
TOOLBAR_CheckStyle (infoPtr);
#ifdef __REACTOS__
infoPtr->szSpacing.cx = DEFSPACE_CX;
infoPtr->szSpacing.cy = DEFSPACE_CY;
+ memset(&infoPtr->themeMargins, 0 , sizeof(infoPtr->themeMargins));
#endif
infoPtr->iListGap = DEFLISTGAP;
infoPtr->iTopMargin = default_top_margin(infoPtr);
return 0;
}
-#ifndef __REACTOS__
+#ifdef __REACTOS__
/* update theme after a WM_THEMECHANGED message */
+static LRESULT theme_changed (TOOLBAR_INFO *infoPtr)
+{
+ HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
+ CloseThemeData (theme);
+ OpenThemeData (infoPtr->hwndSelf, themeClass);
+ theme = GetWindowTheme (infoPtr->hwndSelf);
+ if (theme)
+ GetThemeMargins(theme, NULL, TP_BUTTON, TS_NORMAL, TMT_CONTENTMARGINS, NULL, &infoPtr->themeMargins);
+ else
+ memset(&infoPtr->themeMargins, 0 ,sizeof(infoPtr->themeMargins));
+
+ return 0;
+}
+#else
static LRESULT theme_changed (HWND hwnd)
{
HTHEME theme = GetWindowTheme (hwnd);
case WM_SYSCOLORCHANGE:
return TOOLBAR_SysColorChange ();
-
- case WM_THEMECHANGED:
+ case WM_THEMECHANGED:
#ifdef __REACTOS__
- return TOOLBAR_ThemeChanged(hwnd);
+ return theme_changed (infoPtr);
#else
return theme_changed (hwnd);
#endif