Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
52c44bd8
Commit
52c44bd8
authored
Sep 09, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Sep 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Scale scroll bar minimum thumb size according to DPI.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e0c0f0f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
scroll.c
dlls/user32/scroll.c
+12
-10
No files found.
dlls/user32/scroll.c
View file @
52c44bd8
...
...
@@ -195,7 +195,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
INT
*
arrowSize
,
INT
*
thumbSize
,
INT
*
thumbPos
)
{
INT
pixels
;
INT
pixels
,
min_thumb_size
;
BOOL
vertical
;
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
...
...
@@ -265,7 +265,8 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
if
(
info
->
page
)
{
*
thumbSize
=
MulDiv
(
pixels
,
info
->
page
,(
info
->
maxVal
-
info
->
minVal
+
1
));
if
(
*
thumbSize
<
SCROLL_MIN_THUMB
)
*
thumbSize
=
SCROLL_MIN_THUMB
;
min_thumb_size
=
MulDiv
(
SCROLL_MIN_THUMB
,
GetDpiForWindow
(
hwnd
),
96
);
if
(
*
thumbSize
<
min_thumb_size
)
*
thumbSize
=
min_thumb_size
;
}
else
*
thumbSize
=
GetSystemMetrics
(
SM_CXVSCROLL
);
...
...
@@ -329,10 +330,10 @@ static void SCROLL_GetScrollBarDrawInfo( HWND hwnd, INT bar,
* Compute the current scroll position based on the thumb position in pixels
* from the top of the scroll-bar.
*/
static
UINT
SCROLL_GetThumbVal
(
SCROLLBAR_INFO
*
infoPtr
,
RECT
*
rect
,
BOOL
vertical
,
INT
pos
)
static
UINT
SCROLL_GetThumbVal
(
HWND
hwnd
,
SCROLLBAR_INFO
*
infoPtr
,
RECT
*
rect
,
BOOL
vertical
,
INT
pos
)
{
INT
thumbSize
;
INT
thumbSize
,
minThumbSize
;
INT
pixels
=
vertical
?
rect
->
bottom
-
rect
->
top
:
rect
->
right
-
rect
->
left
;
INT
range
;
...
...
@@ -342,7 +343,8 @@ static UINT SCROLL_GetThumbVal( SCROLLBAR_INFO *infoPtr, RECT *rect,
if
(
infoPtr
->
page
)
{
thumbSize
=
MulDiv
(
pixels
,
infoPtr
->
page
,(
infoPtr
->
maxVal
-
infoPtr
->
minVal
+
1
));
if
(
thumbSize
<
SCROLL_MIN_THUMB
)
thumbSize
=
SCROLL_MIN_THUMB
;
minThumbSize
=
MulDiv
(
SCROLL_MIN_THUMB
,
GetDpiForWindow
(
hwnd
),
96
);
if
(
thumbSize
<
minThumbSize
)
thumbSize
=
minThumbSize
;
}
else
thumbSize
=
GetSystemMetrics
(
SM_CXVSCROLL
);
...
...
@@ -938,7 +940,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
g_tracking_info
.
win
=
hwnd
;
g_tracking_info
.
bar
=
nBar
;
g_tracking_info
.
thumb_pos
=
trackThumbPos
+
lastMousePos
-
lastClickPos
;
g_tracking_info
.
thumb_val
=
SCROLL_GetThumbVal
(
infoPtr
,
&
rect
,
vertical
,
g_tracking_info
.
thumb_val
=
SCROLL_GetThumbVal
(
hwnd
,
infoPtr
,
&
rect
,
vertical
,
g_tracking_info
.
thumb_pos
);
if
(
!
SCROLL_MovingThumb
)
{
...
...
@@ -964,7 +966,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
{
lastMousePos
=
pos
;
g_tracking_info
.
thumb_pos
=
trackThumbPos
+
pos
-
lastClickPos
;
g_tracking_info
.
thumb_val
=
SCROLL_GetThumbVal
(
infoPtr
,
&
rect
,
vertical
,
g_tracking_info
.
thumb_val
=
SCROLL_GetThumbVal
(
hwnd
,
infoPtr
,
&
rect
,
vertical
,
g_tracking_info
.
thumb_pos
);
SendMessageW
(
hwndOwner
,
vertical
?
WM_VSCROLL
:
WM_HSCROLL
,
MAKEWPARAM
(
SB_THUMBTRACK
,
g_tracking_info
.
thumb_val
),
...
...
@@ -1012,7 +1014,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
if
(
hittest
==
SCROLL_THUMB
)
{
UINT
val
=
SCROLL_GetThumbVal
(
infoPtr
,
&
rect
,
vertical
,
UINT
val
=
SCROLL_GetThumbVal
(
hwnd
,
infoPtr
,
&
rect
,
vertical
,
trackThumbPos
+
lastMousePos
-
lastClickPos
);
SendMessageW
(
hwndOwner
,
vertical
?
WM_VSCROLL
:
WM_HSCROLL
,
MAKEWPARAM
(
SB_THUMBTRACK
,
val
),
(
LPARAM
)
hwndCtl
);
...
...
@@ -1026,7 +1028,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
if
(
hittest
==
SCROLL_THUMB
)
{
UINT
val
=
SCROLL_GetThumbVal
(
infoPtr
,
&
rect
,
vertical
,
UINT
val
=
SCROLL_GetThumbVal
(
hwnd
,
infoPtr
,
&
rect
,
vertical
,
trackThumbPos
+
lastMousePos
-
lastClickPos
);
SendMessageW
(
hwndOwner
,
vertical
?
WM_VSCROLL
:
WM_HSCROLL
,
MAKEWPARAM
(
SB_THUMBPOSITION
,
val
),
(
LPARAM
)
hwndCtl
);
...
...
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