From 29f3e570c3010e74c4d38cbb319497da69652bc0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 9 Jun 2022 19:16:36 +0200 Subject: [PATCH] GUI: Fix editing of colored string in List. Bug #13541 --- gui/widgets/list.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index cc047f0a29e..3e38c38fe64 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -667,7 +667,7 @@ void ListWidget::scrollToEnd() { void ListWidget::startEditMode() { if (_editable && !_editMode && _selectedItem >= 0) { _editMode = true; - setEditString(_list[_selectedItem]); + setEditString(stripGUIformatting(_list[_selectedItem])); _caretPos = _editString.size(); // Force caret to the *end* of the selection. _editColor = ThemeEngine::kFontColorNormal; markAsDirty(); @@ -918,7 +918,7 @@ void ListWidget::drawFormattedText(const Common::Rect &r, const Common::U32Strin } } - if (chunk.size()) + if (chunk.size() || str.empty()) g_gui.theme()->drawText(r, chunk, state, align, inverted, deltax, true, curfont, curcolor); }