Skip to content

Commit

Permalink
Client|Console: Adjusted scrolling in LogWidget and ConsoleWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 12, 2013
1 parent a79a605 commit 9503a6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/widgets/logwidget.h
Expand Up @@ -49,6 +49,7 @@ class LogWidget : public ScrollAreaWidget
void clear();

void setContentYOffset(de::Animation const &anim);
de::Animation const &contentYOffset() const;

// Events.
void viewResized();
Expand Down
5 changes: 3 additions & 2 deletions doomsday/client/src/ui/widgets/consolewidget.cpp
Expand Up @@ -89,13 +89,14 @@ DENG2_PIMPL(ConsoleWidget)
if(useOffsetAnimation)
{
// Sync the log content with the height animation.
log->setContentYOffset(Animation::range(Animation::EaseIn, delta, 0,
log->setContentYOffset(Animation::range(Animation::EaseOut,
log->contentYOffset().value() + delta, 0,
height->animation().remainingTime()));
}
}
};

ConsoleWidget::ConsoleWidget() : GuiWidget("Console"), d(new Instance(this))
ConsoleWidget::ConsoleWidget() : GuiWidget("console"), d(new Instance(this))
{
Rule const &unit = style().rules().rule("unit");

Expand Down
5 changes: 5 additions & 0 deletions doomsday/client/src/ui/widgets/logwidget.cpp
Expand Up @@ -809,6 +809,11 @@ void LogWidget::setContentYOffset(Animation const &anim)
}
}

Animation const &LogWidget::contentYOffset() const
{
return d->contentOffset;
}

void LogWidget::viewResized()
{
d->updateProjection();
Expand Down

0 comments on commit 9503a6b

Please sign in to comment.