Author: akhaldi
Date: Fri Jun 12 19:11:48 2015
New Revision: 68111
URL:
http://svn.reactos.org/svn/reactos?rev=68111&view=rev
Log:
[COMCTL32][EXPLORER][UXTHEME] Properly draw the taskbar rebar when themes are enabled.
Brought to you by Stefano Toncich aka Tonix. CORE-8901
Modified:
trunk/reactos/base/shell/explorer/trayntfy.cpp
trunk/reactos/base/shell/explorer/traywnd.cpp
trunk/reactos/dll/win32/comctl32/rebar.c
trunk/reactos/dll/win32/uxtheme/draw.c
trunk/reactos/dll/win32/uxtheme/msstyles.c
Modified: trunk/reactos/base/shell/explorer/trayntfy.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traynt…
==============================================================================
--- trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/trayntfy.cpp [iso-8859-1] Fri Jun 12 19:11:48 2015
@@ -1447,6 +1447,7 @@
LRESULT DrawBackground(HDC hdc)
{
+ HRESULT res;
RECT rect;
GetClientRect(&rect);
@@ -1458,10 +1459,10 @@
DrawThemeParentBackground(m_hWnd, hdc, &rect);
}
- DrawThemeBackground(TrayTheme, hdc, TNP_BACKGROUND, 0, &rect, 0);
- }
-
- return TRUE;
+ res = DrawThemeBackground(TrayTheme, hdc, TNP_BACKGROUND, 0, &rect, 0);
+ }
+
+ return res;
}
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
Modified: trunk/reactos/base/shell/explorer/traywnd.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traywn…
==============================================================================
--- trunk/reactos/base/shell/explorer/traywnd.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/traywnd.cpp [iso-8859-1] Fri Jun 12 19:11:48 2015
@@ -1838,6 +1838,7 @@
{
RECT rect;
int partId;
+ HRESULT res;
GetClientRect(&rect);
@@ -1860,11 +1861,10 @@
partId = TBP_BACKGROUNDBOTTOM;
break;
}
-
- DrawThemeBackground(m_Theme, hdc, partId, 0, &rect, 0);
- }
-
- return TRUE;
+ res = DrawThemeBackground(m_Theme, hdc, partId, 0, &rect, 0);
+ }
+
+ return res;
}
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
@@ -1911,7 +1911,10 @@
rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZEFRAME);
break;
}
-
+ if (IsThemeBackgroundPartiallyTransparent(m_Theme, backoundPart, 0))
+ {
+ DrawThemeParentBackground(m_hWnd, hdc, &rect);
+ }
DrawThemeBackground(m_Theme, hdc, backoundPart, 0, &rect, 0);
ReleaseDC(m_hWnd, hdc);
Modified: trunk/reactos/dll/win32/comctl32/rebar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c…
==============================================================================
--- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Fri Jun 12 19:11:48 2015
@@ -1831,6 +1831,17 @@
HRGN hrgn;
GetClientRect (infoPtr->hwndSelf, &cr);
+
+#ifdef __REACTOS__
+ if (theme)
+ {
+ if (IsThemeBackgroundPartiallyTransparent(theme, RP_BACKGROUND, 0))
+ {
+ DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &cr);
+ }
+ DrawThemeBackground (theme, hdc, 0, 0, &cr, NULL);
+ }
+#endif
hrgn = CreateRectRgn(cr.left, cr.top, cr.right, cr.bottom);
oldrow = -1;
@@ -1921,6 +1932,9 @@
#endif
}
+#ifdef __REACTOS__
+ if (!theme)
+#else
if (theme)
{
/* When themed, the background color is ignored (but not a
@@ -1928,6 +1942,7 @@
DrawThemeBackground (theme, hdc, 0, 0, &cr, &rcBand);
}
else
+#endif
{
old = SetBkColor (hdc, new);
TRACE("%s background color=0x%06x, band %s\n",
@@ -1945,6 +1960,9 @@
}
#if 1
+#ifdef __REACTOS__
+ if (!theme)
+#endif
{
//FIXME: Apparently painting the remaining area is a v6 feature
HBRUSH hbrush = CreateSolidBrush(new);
@@ -3243,7 +3261,11 @@
else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
{
/* FIXME: should use GetThemeInt */
+#ifdef __REACTOS__
+ rect->top = (rect->top + 1 < rect->bottom) ? rect->top :
rect->bottom;
+#else
rect->top = min(rect->top + 1, rect->bottom);
+#endif
}
TRACE("new client=(%s)\n", wine_dbgstr_rect(rect));
return 0;
Modified: trunk/reactos/dll/win32/uxtheme/draw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/draw.c?r…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/draw.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/draw.c [iso-8859-1] Fri Jun 12 19:11:48 2015
@@ -2087,6 +2087,9 @@
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype);
+#ifdef __REACTOS__
+ if (bgtype == BT_NONE) return TRUE;
+#endif
if (bgtype != BT_IMAGEFILE) return FALSE;
if(FAILED (UXTHEME_LoadImage (hTheme, 0, iPartId, iStateId, &rect, FALSE,
Modified: trunk/reactos/dll/win32/uxtheme/msstyles.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/msstyles…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/msstyles.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/msstyles.c [iso-8859-1] Fri Jun 12 19:11:48 2015
@@ -763,6 +763,9 @@
PTHEME_CLASS MSSTYLES_OpenThemeClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWSTR
pszClassList)
{
PTHEME_CLASS cls = NULL;
+#ifdef __REACTOS__
+ PTHEME_CLASS defaultCls = NULL;
+#endif
WCHAR szClassName[MAX_THEME_CLASS_NAME];
LPCWSTR start;
LPCWSTR end;
@@ -779,10 +782,18 @@
start = end+1;
cls = MSSTYLES_FindClass(tf, pszAppName, szClassName);
if(cls) break;
+#ifdef __REACTOS__
+ if (!defaultCls)
+ defaultCls = MSSTYLES_FindClass(tf, NULL, szClassName);
+#endif
}
if(!cls && *start) {
lstrcpynW(szClassName, start, sizeof(szClassName)/sizeof(szClassName[0]));
cls = MSSTYLES_FindClass(tf, pszAppName, szClassName);
+#ifdef __REACTOS__
+ if (!defaultCls)
+ defaultCls = MSSTYLES_FindClass(tf, NULL, szClassName);
+#endif
}
if(cls) {
TRACE("Opened app %s, class %s from list %s\n",
debugstr_w(cls->szAppName), debugstr_w(cls->szClassName),
debugstr_w(pszClassList));
@@ -790,6 +801,16 @@
cls->tf->dwRefCount++;
TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
}
+#ifdef __REACTOS__
+ else if (defaultCls)
+ {
+ cls = defaultCls;
+ TRACE("Opened default class %s from list %s\n",
debugstr_w(cls->szClassName), debugstr_w(pszClassList));
+ cls->tf = tf;
+ cls->tf->dwRefCount++;
+ TRACE("Theme %p refcount: %d\n", tf, tf->dwRefCount);
+ }
+#endif
return cls;
}