mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 15:08:19 +00:00
Don't make width depend on localized text
or we end up with totally broken input boxes
This commit is contained in:
parent
870003db3d
commit
6a0a1ce522
|
@ -521,15 +521,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
QuickSearch.Margin(2.f, &QuickSearch);
|
||||
QuickExclude.Margin(2.f, &QuickExclude);
|
||||
|
||||
char aBufSearch[64];
|
||||
str_format(aBufSearch, sizeof(aBufSearch), "%s:", Localize("Search"));
|
||||
float SearchStrWidth = TextRender()->TextWidth(0, 14.0f, aBufSearch, -1, -1.0f);
|
||||
char aBufExclude[64];
|
||||
str_format(aBufExclude, sizeof(aBufExclude), "%s:", Localize("Exclude"));
|
||||
float ExcludeStrWidth = TextRender()->TextWidth(0, 14.0f, aBufExclude, -1, -1.0f);
|
||||
float ServerAddrStrWidth = TextRender()->TextWidth(0, 14.0f, Localize("Server address:"), -1, -1.0f);
|
||||
|
||||
float SearchExcludeAddrStrMax = maximum(maximum(SearchStrWidth, ExcludeStrWidth), ServerAddrStrWidth);
|
||||
float SearchExcludeAddrStrMax = 130.0f;
|
||||
|
||||
float SearchIconWidth = 0;
|
||||
float ExcludeIconWidth = 0;
|
||||
|
@ -550,6 +542,8 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
QuickSearch.VSplitLeft(ExcludeSearchIconMax, 0, &QuickSearch);
|
||||
QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch);
|
||||
|
||||
char aBufSearch[64];
|
||||
str_format(aBufSearch, sizeof(aBufSearch), "%s:", Localize("Search"));
|
||||
UI()->DoLabelScaled(&QuickSearch, aBufSearch, 14.0f, -1);
|
||||
QuickSearch.VSplitLeft(SearchExcludeAddrStrMax, 0, &QuickSearch);
|
||||
QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch);
|
||||
|
@ -572,6 +566,8 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
QuickExclude.VSplitLeft(ExcludeSearchIconMax, 0, &QuickExclude);
|
||||
QuickExclude.VSplitLeft(5.0f, 0, &QuickExclude);
|
||||
|
||||
char aBufExclude[64];
|
||||
str_format(aBufExclude, sizeof(aBufExclude), "%s:", Localize("Exclude"));
|
||||
UI()->DoLabelScaled(&QuickExclude, aBufExclude, 14.0f, -1);
|
||||
QuickExclude.VSplitLeft(SearchExcludeAddrStrMax, 0, &QuickExclude);
|
||||
QuickExclude.VSplitLeft(5.0f, 0, &QuickExclude);
|
||||
|
|
Loading…
Reference in a new issue