Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
780e5c83
Commit
780e5c83
authored
Jul 06, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Draw scroll bar size box and size grip in a single function.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09f43e04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
29 deletions
+33
-29
scroll.c
dlls/user32/scroll.c
+33
-29
No files found.
dlls/user32/scroll.c
View file @
780e5c83
...
...
@@ -296,6 +296,16 @@ static void SCROLL_GetScrollBarDrawInfo( HWND hwnd, INT bar,
{
INT
pos
,
max_size
;
if
(
bar
==
SB_CTL
&&
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
(
SBS_SIZEGRIP
|
SBS_SIZEBOX
))
{
GetClientRect
(
hwnd
,
rect
);
*
arrow_size
=
0
;
*
thumb_pos
=
0
;
*
thumb_size
=
0
;
*
vertical
=
FALSE
;
return
;
}
*
vertical
=
SCROLL_GetScrollBarRect
(
hwnd
,
bar
,
rect
,
arrow_size
,
thumb_size
,
thumb_pos
);
if
(
SCROLL_MovingThumb
&&
tracking_info
->
win
==
hwnd
&&
tracking_info
->
bar
==
bar
)
...
...
@@ -564,6 +574,28 @@ static void SCROLL_DoDrawScrollBar( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HI
{
SCROLLBAR_INFO
*
infoPtr
;
if
(
nBar
==
SB_CTL
)
{
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
style
&
SBS_SIZEGRIP
)
{
RECT
rc
=
*
rect
;
FillRect
(
hdc
,
&
rc
,
GetSysColorBrush
(
COLOR_SCROLLBAR
)
);
rc
.
left
=
max
(
rc
.
left
,
rc
.
right
-
GetSystemMetrics
(
SM_CXVSCROLL
)
-
1
);
rc
.
top
=
max
(
rc
.
top
,
rc
.
bottom
-
GetSystemMetrics
(
SM_CYHSCROLL
)
-
1
);
DrawFrameControl
(
hdc
,
&
rc
,
DFC_SCROLL
,
DFCS_SCROLLSIZEGRIP
);
return
;
}
if
(
style
&
SBS_SIZEBOX
)
{
FillRect
(
hdc
,
rect
,
GetSysColorBrush
(
COLOR_SCROLLBAR
)
);
return
;
}
}
if
(
!
(
infoPtr
=
SCROLL_GetInternalInfo
(
hwnd
,
nBar
,
TRUE
)))
return
;
...
...
@@ -659,23 +691,6 @@ void SCROLL_DrawNCScrollBar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw
}
/***********************************************************************
* SCROLL_DrawSizeGrip
*
* Draw the size grip.
*/
static
void
SCROLL_DrawSizeGrip
(
HWND
hwnd
,
HDC
hdc
)
{
RECT
rc
;
GetClientRect
(
hwnd
,
&
rc
);
FillRect
(
hdc
,
&
rc
,
GetSysColorBrush
(
COLOR_SCROLLBAR
)
);
rc
.
left
=
max
(
rc
.
left
,
rc
.
right
-
GetSystemMetrics
(
SM_CXVSCROLL
)
-
1
);
rc
.
top
=
max
(
rc
.
top
,
rc
.
bottom
-
GetSystemMetrics
(
SM_CYHSCROLL
)
-
1
);
DrawFrameControl
(
hdc
,
&
rc
,
DFC_SCROLL
,
DFCS_SCROLLSIZEGRIP
);
}
/***********************************************************************
* SCROLL_RefreshScrollBar
*
* Repaint the scroll bar interior after a SetScrollRange() or
...
...
@@ -1413,18 +1428,7 @@ LRESULT ScrollBarWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
PAINTSTRUCT
ps
;
HDC
hdc
=
wParam
?
(
HDC
)
wParam
:
BeginPaint
(
hwnd
,
&
ps
);
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
SBS_SIZEGRIP
)
{
SCROLL_DrawSizeGrip
(
hwnd
,
hdc
);
}
else
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
SBS_SIZEBOX
)
{
RECT
rc
;
GetClientRect
(
hwnd
,
&
rc
);
FillRect
(
hdc
,
&
rc
,
GetSysColorBrush
(
COLOR_SCROLLBAR
)
);
}
else
SCROLL_DrawScrollBar
(
hwnd
,
hdc
,
SB_CTL
,
g_tracking_info
.
hit_test
,
&
g_tracking_info
,
TRUE
,
TRUE
);
SCROLL_DrawScrollBar
(
hwnd
,
hdc
,
SB_CTL
,
g_tracking_info
.
hit_test
,
&
g_tracking_info
,
TRUE
,
TRUE
);
if
(
!
wParam
)
EndPaint
(
hwnd
,
&
ps
);
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment