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
b406377d
Commit
b406377d
authored
Mar 22, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Enable and show the scrollbar before updating its position and range.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6f397315
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
paint.c
dlls/riched20/paint.c
+20
-18
No files found.
dlls/riched20/paint.c
View file @
b406377d
...
...
@@ -1033,6 +1033,14 @@ static void draw_paragraph( ME_Context *c, ME_Paragraph *para )
SetTextAlign
(
c
->
hDC
,
align
);
}
static
void
enable_show_scrollbar
(
ME_TextEditor
*
editor
,
INT
bar
,
BOOL
enable
)
{
if
(
enable
||
editor
->
scrollbars
&
ES_DISABLENOSCROLL
)
ITextHost_TxEnableScrollBar
(
editor
->
texthost
,
bar
,
enable
?
0
:
ESB_DISABLE_BOTH
);
if
(
!
(
editor
->
scrollbars
&
ES_DISABLENOSCROLL
))
ITextHost_TxShowScrollBar
(
editor
->
texthost
,
bar
,
enable
);
}
static
void
set_scroll_range_pos
(
ITextHost
*
host
,
INT
bar
,
SCROLLINFO
*
info
,
BOOL
set_range
)
{
LONG
max_pos
=
info
->
nMax
,
pos
=
info
->
nPos
;
...
...
@@ -1145,6 +1153,12 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
return
;
}
if
(
editor
->
scrollbars
&
WS_HSCROLL
&&
!
enable
^
!
editor
->
horz_sb_enabled
)
{
editor
->
horz_sb_enabled
=
enable
;
enable_show_scrollbar
(
editor
,
SB_HORZ
,
enable
);
}
if
(
editor
->
horz_si
.
nMax
!=
editor
->
nTotalWidth
||
editor
->
horz_si
.
nPage
!=
editor
->
sizeWindow
.
cx
)
{
editor
->
horz_si
.
nMax
=
editor
->
nTotalWidth
;
...
...
@@ -1154,15 +1168,6 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
set_scroll_range_pos
(
editor
->
texthost
,
SB_HORZ
,
&
editor
->
horz_si
,
TRUE
);
}
if
(
editor
->
scrollbars
&
WS_HSCROLL
&&
!
enable
^
!
editor
->
horz_sb_enabled
)
{
if
(
enable
||
editor
->
scrollbars
&
ES_DISABLENOSCROLL
)
ITextHost_TxEnableScrollBar
(
editor
->
texthost
,
SB_HORZ
,
enable
?
0
:
ESB_DISABLE_BOTH
);
if
(
!
(
editor
->
scrollbars
&
ES_DISABLENOSCROLL
))
ITextHost_TxShowScrollBar
(
editor
->
texthost
,
SB_HORZ
,
enable
);
editor
->
horz_sb_enabled
=
enable
;
}
/* Update vertical scrollbar */
enable
=
editor
->
nTotalLength
>
editor
->
sizeWindow
.
cy
&&
(
editor
->
props
&
TXTBIT_MULTILINE
);
...
...
@@ -1173,6 +1178,12 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
return
;
}
if
(
editor
->
scrollbars
&
WS_VSCROLL
&&
!
enable
^
!
editor
->
vert_sb_enabled
)
{
editor
->
vert_sb_enabled
=
enable
;
enable_show_scrollbar
(
editor
,
SB_VERT
,
enable
);
}
if
(
editor
->
vert_si
.
nMax
!=
editor
->
nTotalLength
||
editor
->
vert_si
.
nPage
!=
editor
->
sizeWindow
.
cy
)
{
editor
->
vert_si
.
nMax
=
editor
->
nTotalLength
;
...
...
@@ -1181,15 +1192,6 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
if
((
enable
||
editor
->
vert_sb_enabled
)
&&
editor
->
scrollbars
&
WS_VSCROLL
)
set_scroll_range_pos
(
editor
->
texthost
,
SB_VERT
,
&
editor
->
vert_si
,
TRUE
);
}
if
(
editor
->
scrollbars
&
WS_VSCROLL
&&
!
enable
^
!
editor
->
vert_sb_enabled
)
{
if
(
enable
||
editor
->
scrollbars
&
ES_DISABLENOSCROLL
)
ITextHost_TxEnableScrollBar
(
editor
->
texthost
,
SB_VERT
,
enable
?
0
:
ESB_DISABLE_BOTH
);
if
(
!
(
editor
->
scrollbars
&
ES_DISABLENOSCROLL
))
ITextHost_TxShowScrollBar
(
editor
->
texthost
,
SB_VERT
,
enable
);
editor
->
vert_sb_enabled
=
enable
;
}
}
void
editor_ensure_visible
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
...
...
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