diff --git a/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp b/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp index d0dee70dd6..d6d676a6e3 100644 --- a/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp +++ b/doomsday/libdeng2/src/core/monospacelogsinkformatter.cpp @@ -18,6 +18,7 @@ */ #include "de/MonospaceLogSinkFormatter" +#include namespace de { @@ -180,7 +181,7 @@ QList MonospaceLogSinkFormatter::logEntryToTextLines(LogEntry const &ent void MonospaceLogSinkFormatter::setMaxLength(duint maxLength) { - _maxLength = maxLength; + _maxLength = de::max(duint(_minimumIndent + 10), maxLength); } duint MonospaceLogSinkFormatter::maxLength() const diff --git a/doomsday/tools/shell/libshell/src/textrootwidget.cpp b/doomsday/tools/shell/libshell/src/textrootwidget.cpp index 8337a1391b..7629eb120a 100644 --- a/doomsday/tools/shell/libshell/src/textrootwidget.cpp +++ b/doomsday/tools/shell/libshell/src/textrootwidget.cpp @@ -40,8 +40,10 @@ TextCanvas &TextRootWidget::rootCanvas() void TextRootWidget::setViewSize(Vector2i const &viewSize) { - _canvas->resize(viewSize); - RootWidget::setViewSize(viewSize); + // Shouldn't go below 1 x 1. + Vector2i vs = viewSize.max(Vector2i(1, 1)); + _canvas->resize(vs); + RootWidget::setViewSize(vs); } TextWidget *TextRootWidget::focus() const diff --git a/doomsday/tools/shell/shell-text/src/logwidget.cpp b/doomsday/tools/shell/shell-text/src/logwidget.cpp index 3cbe810bf3..66c56816c2 100644 --- a/doomsday/tools/shell/shell-text/src/logwidget.cpp +++ b/doomsday/tools/shell/shell-text/src/logwidget.cpp @@ -77,11 +77,11 @@ struct LogWidget::Instance { Sink sink; MonospaceLogSinkFormatter formatter; - QList cache; + int cacheWidth; + QList cache; ///< Indices match entry indices in sink. - Instance(LogWidget &inst) : sink(inst) - { - } + Instance(LogWidget &inst) : sink(inst), cacheWidth(0) + {} ~Instance() { @@ -116,9 +116,10 @@ void LogWidget::draw() Rectanglei pos = rule().recti(); TextCanvas buf(pos.size()); - if(d->formatter.maxLength() != duint(pos.width())) + if(d->cacheWidth != pos.width()) { - d->formatter.setMaxLength(pos.width()); + d->cacheWidth = pos.width(); + d->formatter.setMaxLength(d->cacheWidth); // Width has changed, zap the cache. d->clearCache();