Skip to content

Commit

Permalink
Fixed|UI|Client: Inadvertent log clearing
Browse files Browse the repository at this point in the history
Now there is a separate method for resetting the height of the log
widget without clearing all entries.

Also the content height of the LogWidget is reset to zero when the
widget is cleared.
  • Loading branch information
skyjake committed Nov 23, 2014
1 parent 348427e commit 4f8426c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/widgets/consolewidget.h
Expand Up @@ -77,6 +77,7 @@ public slots:
void openLog();
void closeLog();
void clearLog();
void zeroLogHeight();
void showFullLog();
void setFullyOpaque();
void commandLineFocusGained();
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/dd_main.cpp
Expand Up @@ -1713,7 +1713,7 @@ bool App_ChangeGame(Game &game, bool allowReload)
}
else
{
ClientWindow::main().console().clearLog();
ClientWindow::main().console().zeroLogHeight();
}
}
#endif
Expand Down
7 changes: 6 additions & 1 deletion doomsday/client/src/ui/widgets/consolewidget.cpp
Expand Up @@ -545,11 +545,16 @@ void ConsoleWidget::closeLog()
}

void ConsoleWidget::clearLog()
{
zeroLogHeight();
d->log->clear();
}

void ConsoleWidget::zeroLogHeight()
{
d->height->set(0);
d->log->scrollToBottom();
d->log->enablePageKeys(false);
d->log->clear();
}

void ConsoleWidget::showFullLog()
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/widgets/taskbarwidget.cpp
Expand Up @@ -602,7 +602,7 @@ void TaskBarWidget::open()

unsetBehavior(DisableEventDispatchToChildren);

d->console->clearLog();
d->console->zeroLogHeight();

d->vertShift->set(0, OPEN_CLOSE_SPAN);
setOpacity(1, OPEN_CLOSE_SPAN);
Expand Down
1 change: 1 addition & 0 deletions doomsday/libappfw/src/widgets/logwidget.cpp
Expand Up @@ -389,6 +389,7 @@ public Font::RichFormat::IStyle
{
sink.clear();
clearCache();
self.setContentHeight(0);
}

void clearCache()
Expand Down

0 comments on commit 4f8426c

Please sign in to comment.