MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / CalculateWidth

Method CalculateWidth

Source/DropdownList.cpp:115–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void DropdownList::CalculateWidth()
116{
117 mMaxItemWidth = mWidth;
118 for (int i = 0; i < mElements.size(); ++i)
119 {
120 int width = GetStringWidth(mElements[i].mLabel) + (mDrawTriangle ? 15 : 3);
121 if (width > mMaxItemWidth)
122 mMaxItemWidth = width;
123 }
124
125 if (mAutoCalculateWidth)
126 mWidth = MIN(mMaxItemWidth, 180);
127}
128
129void DropdownList::SetWidth(int width)
130{

Callers

nothing calls this directly

Calls 2

GetStringWidthFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected