MCPcopy Create free account
hub / github.com/ddnet/ddnet / DoHeader

Method DoHeader

src/game/client/ui_listbox.cpp:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void CListBox::DoHeader(const CUIRect *pRect, const char *pTitle, float HeaderHeight, float Spacing)
32{
33 CUIRect View = *pRect;
34 CUIRect Header;
35
36 // background
37 View.HSplitTop(HeaderHeight + Spacing, &Header, nullptr);
38 Header.Draw(ColorRGBA(0.0f, 0.0f, 0.0f, 0.15f), m_BackgroundCorners & IGraphics::CORNER_T, 5.0f);
39
40 // draw header
41 View.HSplitTop(HeaderHeight, &Header, &View);
42 Ui()->DoLabel(&Header, pTitle, Header.h * CUi::ms_FontmodHeight * 0.8f, TEXTALIGN_MC);
43
44 View.HSplitTop(Spacing, &Header, &View);
45
46 // setup the variables
47 m_ListBoxView = View;
48 m_HasHeader = true;
49}
50
51void CListBox::DoSpacing(float Spacing)
52{

Callers 1

RenderThemeSelectionMethod · 0.80

Calls 5

UiFunction · 0.85
HSplitTopMethod · 0.80
DoLabelMethod · 0.80
ColorRGBAClass · 0.50
DrawMethod · 0.45

Tested by

no test coverage detected