aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/ListWidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 82f92d81a5..f590edf889 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -347,9 +347,11 @@ void ListWidget::drawWidget(bool hilite) {
int maxWidth = _textWidth[i];
buffer = _list[pos];
deltax = 0;
- if (_selectedItem != pos)
+ if (_selectedItem != pos) {
width = g_gui.getStringWidth(buffer);
- else
+ if (width > _w - r.left - 2)
+ width = _w - r.left - 2;
+ } else
width = _w - r.left - 2;
if (width > maxWidth)
maxWidth = width;