Add UpdateAutoScroll calls to some events where they were missing. For example when deleting, cutting, pasting, autocompleting or doubleclicking text. Patch by Vladislav, fixes #4401.

This was SVN commit r19234.
This commit is contained in:
elexis 2017-02-22 15:28:09 +00:00
parent baea68def2
commit e1e4ef0370

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016 Wildfire Games. /* Copyright (C) 2017 Wildfire Games.
* This file is part of 0 A.D. * This file is part of 0 A.D.
* *
* 0 A.D. is free software: you can redistribute it and/or modify * 0 A.D. is free software: you can redistribute it and/or modify
@ -461,10 +461,12 @@ InReaction CInput::ManuallyHandleEvent(const SDL_Event_* ev)
case SDLK_PAGEUP: case SDLK_PAGEUP:
GetScrollBar(0).ScrollMinusPlenty(); GetScrollBar(0).ScrollMinusPlenty();
UpdateAutoScroll();
break; break;
case SDLK_PAGEDOWN: case SDLK_PAGEDOWN:
GetScrollBar(0).ScrollPlusPlenty(); GetScrollBar(0).ScrollPlusPlenty();
UpdateAutoScroll();
break; break;
/* END: Message History Lookup */ /* END: Message History Lookup */
@ -551,6 +553,7 @@ InReaction CInput::ManuallyHandleHotkeyEvent(const SDL_Event_* ev)
UpdateText(m_iBufferPos, m_iBufferPos, m_iBufferPos+1); UpdateText(m_iBufferPos, m_iBufferPos, m_iBufferPos+1);
m_iBufferPos += (int)wcslen(text); m_iBufferPos += (int)wcslen(text);
UpdateAutoScroll();
UpdateBufferPositionSetting(); UpdateBufferPositionSetting();
sys_clipboard_free(text); sys_clipboard_free(text);
@ -585,6 +588,7 @@ InReaction CInput::ManuallyHandleHotkeyEvent(const SDL_Event_* ev)
if (hotkey == "cut") if (hotkey == "cut")
{ {
DeleteCurSelection(); DeleteCurSelection();
UpdateAutoScroll();
} }
} }
@ -630,6 +634,7 @@ InReaction CInput::ManuallyHandleHotkeyEvent(const SDL_Event_* ev)
UpdateBufferPositionSetting(); UpdateBufferPositionSetting();
DeleteCurSelection(); DeleteCurSelection();
} }
UpdateAutoScroll();
return IN_HANDLED; return IN_HANDLED;
} }
else if (hotkey == "text.delete.right") else if (hotkey == "text.delete.right")
@ -663,6 +668,7 @@ InReaction CInput::ManuallyHandleHotkeyEvent(const SDL_Event_* ev)
UpdateBufferPositionSetting(); UpdateBufferPositionSetting();
DeleteCurSelection(); DeleteCurSelection();
} }
UpdateAutoScroll();
return IN_HANDLED; return IN_HANDLED;
} }
else if (hotkey == "text.move.left") else if (hotkey == "text.move.left")
@ -840,6 +846,7 @@ void CInput::HandleMessage(SGUIMessage& Message)
UpdateText(); UpdateText();
} }
UpdateAutoScroll();
break; break;
} }
@ -987,6 +994,7 @@ void CInput::HandleMessage(SGUIMessage& Message)
break; break;
} }
} }
UpdateAutoScroll();
break; break;
} }
@ -1022,6 +1030,7 @@ void CInput::HandleMessage(SGUIMessage& Message)
GetScrollBar(0).SetScrollBarStyle(scrollbar_style); GetScrollBar(0).SetScrollBarStyle(scrollbar_style);
UpdateText(); UpdateText();
UpdateAutoScroll();
break; break;
} }