riched20: Simplify the scrollbar visibility checks.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5b3816c0b2
commit
39f5c438c5
|
@ -1035,7 +1035,7 @@ static void draw_paragraph( ME_Context *c, ME_Paragraph *para )
|
||||||
|
|
||||||
void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
|
void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
|
||||||
{
|
{
|
||||||
BOOL bScrollBarIsVisible, bScrollBarWillBeVisible;
|
BOOL old_vis, new_vis;
|
||||||
int scrollX = 0, scrollY = 0;
|
int scrollX = 0, scrollY = 0;
|
||||||
|
|
||||||
if (editor->horz_si.nPos != x) {
|
if (editor->horz_si.nPos != x) {
|
||||||
|
@ -1072,25 +1072,17 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
|
||||||
LONG winStyle = GetWindowLongW(editor->hWnd, GWL_STYLE);
|
LONG winStyle = GetWindowLongW(editor->hWnd, GWL_STYLE);
|
||||||
if (editor->scrollbars & WS_HSCROLL)
|
if (editor->scrollbars & WS_HSCROLL)
|
||||||
{
|
{
|
||||||
bScrollBarIsVisible = (winStyle & WS_HSCROLL) != 0;
|
old_vis = winStyle & WS_HSCROLL;
|
||||||
bScrollBarWillBeVisible = (editor->nTotalWidth > editor->sizeWindow.cx
|
new_vis = editor->nTotalWidth > editor->sizeWindow.cx || editor->scrollbars & ES_DISABLENOSCROLL;
|
||||||
&& (editor->scrollbars & WS_HSCROLL))
|
if (!old_vis ^ !new_vis) ITextHost_TxShowScrollBar( editor->texthost, SB_HORZ, new_vis );
|
||||||
|| (editor->scrollbars & ES_DISABLENOSCROLL);
|
|
||||||
if (bScrollBarIsVisible != bScrollBarWillBeVisible)
|
|
||||||
ITextHost_TxShowScrollBar(editor->texthost, SB_HORZ,
|
|
||||||
bScrollBarWillBeVisible);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editor->scrollbars & WS_VSCROLL)
|
if (editor->scrollbars & WS_VSCROLL)
|
||||||
{
|
{
|
||||||
bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0;
|
old_vis = winStyle & WS_VSCROLL;
|
||||||
bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy
|
new_vis = (editor->nTotalLength > editor->sizeWindow.cy && editor->props & TXTBIT_MULTILINE) ||
|
||||||
&& (editor->scrollbars & WS_VSCROLL)
|
editor->scrollbars & ES_DISABLENOSCROLL;
|
||||||
&& (editor->props & TXTBIT_MULTILINE))
|
if (!old_vis ^ !new_vis) ITextHost_TxShowScrollBar( editor->texthost, SB_VERT, new_vis );
|
||||||
|| (editor->scrollbars & ES_DISABLENOSCROLL);
|
|
||||||
if (bScrollBarIsVisible != bScrollBarWillBeVisible)
|
|
||||||
ITextHost_TxShowScrollBar(editor->texthost, SB_VERT,
|
|
||||||
bScrollBarWillBeVisible);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ME_UpdateScrollBar(editor);
|
ME_UpdateScrollBar(editor);
|
||||||
|
|
Loading…
Reference in New Issue