Commit 6799667b authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/trackbar: Update control parts when style changed.

Fix trackbar draws incorrectly after changing style. For example, adding TBS_BOTH should cause a total repaint. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8107462b
...@@ -1502,6 +1502,19 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr) ...@@ -1502,6 +1502,19 @@ TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr)
return 0; return 0;
} }
static void TRACKBAR_RecalculateAll (TRACKBAR_INFO *infoPtr)
{
if (infoPtr->dwStyle & TBS_FIXEDLENGTH)
{
TRACKBAR_CalcChannel(infoPtr);
TRACKBAR_UpdateThumb(infoPtr);
}
else
{
TRACKBAR_InitializeThumb(infoPtr);
}
TRACKBAR_AlignBuddies(infoPtr);
}
static LRESULT static LRESULT
TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
...@@ -1677,14 +1690,7 @@ TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr) ...@@ -1677,14 +1690,7 @@ TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr)
static LRESULT static LRESULT
TRACKBAR_Size (TRACKBAR_INFO *infoPtr) TRACKBAR_Size (TRACKBAR_INFO *infoPtr)
{ {
if (infoPtr->dwStyle & TBS_FIXEDLENGTH) TRACKBAR_RecalculateAll(infoPtr);
{
TRACKBAR_CalcChannel(infoPtr);
TRACKBAR_UpdateThumb(infoPtr);
}
else
TRACKBAR_InitializeThumb(infoPtr);
TRACKBAR_AlignBuddies (infoPtr);
TRACKBAR_InvalidateAll(infoPtr); TRACKBAR_InvalidateAll(infoPtr);
return 0; return 0;
...@@ -1697,7 +1703,8 @@ TRACKBAR_StyleChanged (TRACKBAR_INFO *infoPtr, WPARAM wStyleType, ...@@ -1697,7 +1703,8 @@ TRACKBAR_StyleChanged (TRACKBAR_INFO *infoPtr, WPARAM wStyleType,
if (wStyleType != GWL_STYLE) return 0; if (wStyleType != GWL_STYLE) return 0;
infoPtr->dwStyle = lpss->styleNew; infoPtr->dwStyle = lpss->styleNew;
TRACKBAR_RecalculateAll(infoPtr);
TRACKBAR_InvalidateAll(infoPtr);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment