Fixed popup widget text limits

This commit is contained in:
thrust26 2020-07-26 21:41:17 +02:00
parent 7834665f39
commit 37af09e3dc
1 changed files with 3 additions and 2 deletions

View File

@ -260,8 +260,9 @@ void PopUpWidget::drawWidget(bool hilite)
// Draw the selected entry, if any // Draw the selected entry, if any
const string& name = myMenu->getSelectedName(); const string& name = myMenu->getSelectedName();
TextAlign align = (_font.getStringWidth(name) > w - 6) ? w -= dropDownWidth(_font);
TextAlign align = (_font.getStringWidth(name) > w) ?
TextAlign::Right : TextAlign::Left; TextAlign::Right : TextAlign::Left;
s.drawString(_font, name, x + _textOfs, _y + myTextY, w - 6, s.drawString(_font, name, x + _textOfs, _y + myTextY, w,
!(isEnabled() && onTop) ? kColor : _changed ? kDbgChangedTextColor : kTextColor, align); !(isEnabled() && onTop) ? kColor : _changed ? kDbgChangedTextColor : kTextColor, align);
} }