2954: Add clear button to server address field r=Jupeyy a=def-

as suggested by Cøke

Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-09-29 23:44:09 +00:00 committed by GitHub
commit c92af2e2df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -612,8 +612,9 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
// address info
UI()->DoLabelScaled(&ServerAddr, Localize("Server address:"), 14.0f, -1);
ServerAddr.VSplitLeft(SearchExcludeAddrStrMax + 5.0f + ExcludeSearchIconMax + 5.0f, NULL, &ServerAddr);
static int s_ClearButton = 0;
static float Offset = 0.0f;
DoEditBox(&g_Config.m_UiServerAddress, &ServerAddr, g_Config.m_UiServerAddress, sizeof(g_Config.m_UiServerAddress), 12.0f, &Offset);
DoClearableEditBox(&g_Config.m_UiServerAddress, &s_ClearButton, &ServerAddr, g_Config.m_UiServerAddress, sizeof(g_Config.m_UiServerAddress), 12.0f, &Offset);
// button area
ButtonArea = ConnectButtons;