fix ComboDialog width

This commit is contained in:
thrust26 2019-05-28 23:28:47 +02:00
parent 43af1a0005
commit bd2185e3f5
1 changed files with 6 additions and 6 deletions

View File

@ -37,17 +37,17 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
int xpos, ypos; int xpos, ypos;
WidgetArray wid; WidgetArray wid;
// Get maximum width of popupwidget
int pwidth = 0;
for (const auto& s : combolist)
pwidth = std::max(font.getStringWidth(s.first), pwidth);
// Set real dimensions // Set real dimensions
_w = 33 * fontWidth + 10*2; _w = 11 * fontWidth + pwidth-4 + 10 * 2;
_h = 10 * (lineHeight + 4) + 10 + _th; _h = 10 * (lineHeight + 4) + 10 + _th;
xpos = 10; xpos = 10;
ypos = 10 + _th; ypos = 10 + _th;
// Get maximum width of popupwidget
int pwidth = 0;
for(const auto& s: combolist)
pwidth = std::max(font.getStringWidth(s.first), pwidth);
// Add event popup for 8 events // Add event popup for 8 events
auto ADD_EVENT_POPUP = [&](int idx, const string& label) auto ADD_EVENT_POPUP = [&](int idx, const string& label)
{ {