mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix scroll bar in server control votes when search bar is used
This commit is contained in:
parent
50a6c30e46
commit
e6db197183
|
@ -461,11 +461,19 @@ void CMenus::RenderServerControlServer(CUIRect MainView)
|
|||
int NumVoteOptions = 0;
|
||||
int aIndices[MAX_VOTE_OPTIONS];
|
||||
static int s_CurVoteOption = 0;
|
||||
int TotalShown = 0;
|
||||
|
||||
for(CVoteOptionClient *pOption = m_pClient->m_pVoting->m_pFirst; pOption; pOption = pOption->m_pNext)
|
||||
{
|
||||
if(m_aFilterString[0] != '\0' && !str_find_nocase(pOption->m_aDescription, m_aFilterString))
|
||||
continue;
|
||||
TotalShown++;
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
UiDoListboxStart(&s_VoteList, &List, 50.0f, "", "", Total, 1, s_CurVoteOption, s_ScrollValue);
|
||||
UiDoListboxStart(&s_VoteList, &List, 50.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue);
|
||||
#else
|
||||
UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", Total, 1, s_CurVoteOption, s_ScrollValue);
|
||||
UiDoListboxStart(&s_VoteList, &List, 24.0f, "", "", TotalShown, 1, s_CurVoteOption, s_ScrollValue);
|
||||
#endif
|
||||
|
||||
int i = -1;
|
||||
|
|
Loading…
Reference in a new issue