uxtheme: Support pressed state for themed scroll bars.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0a83027e20
commit
8c38f02d23
|
@ -75,6 +75,18 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
|
||||||
lowertrackstate = SCRBS_NORMAL;
|
lowertrackstate = SCRBS_NORMAL;
|
||||||
thumbstate = SCRBS_NORMAL;
|
thumbstate = SCRBS_NORMAL;
|
||||||
|
|
||||||
|
if (vertical == tracking_info->vertical && hit_test == tracking_info->hit_test
|
||||||
|
&& GetCapture() == hwnd)
|
||||||
|
{
|
||||||
|
if (hit_test == SCROLL_TOP_RECT)
|
||||||
|
uppertrackstate = SCRBS_PRESSED;
|
||||||
|
else if (hit_test == SCROLL_BOTTOM_RECT)
|
||||||
|
lowertrackstate = SCRBS_PRESSED;
|
||||||
|
else if (hit_test == SCROLL_THUMB)
|
||||||
|
thumbstate = SCRBS_PRESSED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (hit_test == SCROLL_TOP_RECT)
|
if (hit_test == SCROLL_TOP_RECT)
|
||||||
uppertrackstate = SCRBS_HOT;
|
uppertrackstate = SCRBS_HOT;
|
||||||
else if (hit_test == SCROLL_BOTTOM_RECT)
|
else if (hit_test == SCROLL_BOTTOM_RECT)
|
||||||
|
@ -83,6 +95,11 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
|
||||||
thumbstate = SCRBS_HOT;
|
thumbstate = SCRBS_HOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Thumb is also shown as pressed when tracking */
|
||||||
|
if (tracking_info->win == hwnd && tracking_info->bar == bar)
|
||||||
|
thumbstate = SCRBS_PRESSED;
|
||||||
|
}
|
||||||
|
|
||||||
if (bar == SB_CTL)
|
if (bar == SB_CTL)
|
||||||
DrawThemeParentBackground(hwnd, dc, NULL);
|
DrawThemeParentBackground(hwnd, dc, NULL);
|
||||||
|
|
||||||
|
@ -96,11 +113,22 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
|
||||||
uparrowstate = ABS_UPNORMAL;
|
uparrowstate = ABS_UPNORMAL;
|
||||||
downarrowstate = ABS_DOWNNORMAL;
|
downarrowstate = ABS_DOWNNORMAL;
|
||||||
|
|
||||||
|
if (vertical == tracking_info->vertical && hit_test == tracking_info->hit_test
|
||||||
|
&& GetCapture() == hwnd)
|
||||||
|
{
|
||||||
|
if (hit_test == SCROLL_TOP_ARROW)
|
||||||
|
uparrowstate = ABS_UPPRESSED;
|
||||||
|
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
||||||
|
downarrowstate = ABS_DOWNPRESSED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (hit_test == SCROLL_TOP_ARROW)
|
if (hit_test == SCROLL_TOP_ARROW)
|
||||||
uparrowstate = ABS_UPHOT;
|
uparrowstate = ABS_UPHOT;
|
||||||
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
||||||
downarrowstate = ABS_DOWNHOT;
|
downarrowstate = ABS_DOWNHOT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
partrect = *rect;
|
partrect = *rect;
|
||||||
partrect.bottom = partrect.top + arrowsize;
|
partrect.bottom = partrect.top + arrowsize;
|
||||||
|
@ -150,11 +178,22 @@ void WINAPI UXTHEME_ScrollBarDraw(HWND hwnd, HDC dc, INT bar, enum SCROLL_HITTES
|
||||||
leftarrowstate = ABS_LEFTNORMAL;
|
leftarrowstate = ABS_LEFTNORMAL;
|
||||||
rightarrowstate = ABS_RIGHTNORMAL;
|
rightarrowstate = ABS_RIGHTNORMAL;
|
||||||
|
|
||||||
|
if (vertical == tracking_info->vertical && hit_test == tracking_info->hit_test
|
||||||
|
&& GetCapture() == hwnd)
|
||||||
|
{
|
||||||
|
if (hit_test == SCROLL_TOP_ARROW)
|
||||||
|
leftarrowstate = ABS_LEFTPRESSED;
|
||||||
|
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
||||||
|
rightarrowstate = ABS_RIGHTPRESSED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (hit_test == SCROLL_TOP_ARROW)
|
if (hit_test == SCROLL_TOP_ARROW)
|
||||||
leftarrowstate = ABS_LEFTHOT;
|
leftarrowstate = ABS_LEFTHOT;
|
||||||
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
else if (hit_test == SCROLL_BOTTOM_ARROW)
|
||||||
rightarrowstate = ABS_RIGHTHOT;
|
rightarrowstate = ABS_RIGHTHOT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
partrect = *rect;
|
partrect = *rect;
|
||||||
partrect.right = partrect.left + arrowsize;
|
partrect.right = partrect.left + arrowsize;
|
||||||
|
|
Loading…
Reference in New Issue