mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add dropdown icon
This commit is contained in:
parent
eb3e472f34
commit
5459895dc0
|
@ -1088,6 +1088,15 @@ int CMenus::RenderDropDown(int &CurDropDownState, CUIRect *pRect, int CurSelecti
|
|||
pRect->HSplitTop(24.0f, &Button, pRect);
|
||||
if(DoButton_MenuTab(pID, CurSelection > -1 ? pStr[CurSelection] : "", 0, &Button, CUI::CORNER_ALL, NULL, NULL, NULL, NULL, 4.0f))
|
||||
CurDropDownState = 1;
|
||||
|
||||
CUIRect DropDownIcon = Button;
|
||||
DropDownIcon.HMargin(2.0f, &DropDownIcon);
|
||||
DropDownIcon.VSplitRight(5.0f, &DropDownIcon, nullptr);
|
||||
TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT));
|
||||
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
|
||||
UI()->DoLabelScaled(&DropDownIcon, "\xEF\x84\xBA", DropDownIcon.h * CUI::ms_FontmodHeight, TEXTALIGN_RIGHT);
|
||||
TextRender()->SetRenderFlags(0);
|
||||
TextRender()->SetCurFont(NULL);
|
||||
return CurSelection;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue