https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc6c07c385c08b5035124…
commit fc6c07c385c08b503512481b996fe404faaf7092
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Thu Nov 23 23:07:35 2017 +0200
[UXTHEME] Add a hack for themed scrollbars
- After inspecting a theme file with different upper or lower tracks it seems that
windows use what is called LowerTrackHorz and LowerTrackVert in the upper track and
UpperTrackHorz and UpperTrackVert are used in the lower track.
CORE-13513
---
dll/win32/uxtheme/ncscrollbar.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dll/win32/uxtheme/ncscrollbar.c b/dll/win32/uxtheme/ncscrollbar.c
index 8d6f21de69..a44edb0024 100644
--- a/dll/win32/uxtheme/ncscrollbar.c
+++ b/dll/win32/uxtheme/ncscrollbar.c
@@ -215,16 +215,18 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext,
SCROLLBARINFO* psbi,
return;
}
+ /* Some themes have different bitmaps for the upper and lower tracks
+ It seems that windows use the bitmap for the lower track in the upper track */
if (vertical)
{
rcPart = r;
rcPart.bottom = thumbPos;
- SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKVERT, BUTTON_NORMAL, psbi,
SCROLL_TOP_RECT, htDown, htHot, &rcPart);
+ SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKVERT, BUTTON_NORMAL, psbi,
SCROLL_TOP_RECT, htDown, htHot, &rcPart);
r.top = rcPart.bottom;
rcPart = r;
rcPart.top += psbi->xyThumbBottom - psbi->xyThumbTop;
- SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKVERT, BUTTON_NORMAL, psbi,
SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart);
+ SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKVERT, BUTTON_NORMAL, psbi,
SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart);
r.bottom = rcPart.top;
SCROLL_ThemeDrawPart(pcontext, SBP_THUMBBTNVERT, BUTTON_NORMAL, psbi,
SCROLL_THUMB, htDown, htHot, &r);
@@ -234,12 +236,12 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext,
SCROLLBARINFO* psbi,
{
rcPart = r;
rcPart.right = thumbPos;
- SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKHORZ, BUTTON_NORMAL, psbi,
SCROLL_TOP_RECT, htDown, htHot, &rcPart);
+ SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKHORZ, BUTTON_NORMAL, psbi,
SCROLL_TOP_RECT, htDown, htHot, &rcPart);
r.left = rcPart.right;
rcPart = r;
rcPart.left += psbi->xyThumbBottom - psbi->xyThumbTop;
- SCROLL_ThemeDrawPart(pcontext, SBP_LOWERTRACKHORZ, BUTTON_NORMAL, psbi,
SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart);
+ SCROLL_ThemeDrawPart(pcontext, SBP_UPPERTRACKHORZ, BUTTON_NORMAL, psbi,
SCROLL_BOTTOM_RECT, htDown, htHot, &rcPart);
r.right = rcPart.left;
SCROLL_ThemeDrawPart(pcontext, SBP_THUMBBTNHORZ, BUTTON_NORMAL, psbi,
SCROLL_THUMB, htDown, htHot, &r);