From 37af09e3dca808ec2c6a063b0dfd887e2c0702b3 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sun, 26 Jul 2020 21:41:17 +0200 Subject: [PATCH] Fixed popup widget text limits --- src/gui/PopUpWidget.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index 589c34660..3f4474fea 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -260,8 +260,9 @@ void PopUpWidget::drawWidget(bool hilite) // Draw the selected entry, if any 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; - 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); }