Skip to content

Commit

Permalink
Fixed|DocumentWidget: Changing style on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jul 30, 2013
1 parent 15b4599 commit 4600b54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions doomsday/client/include/ui/widgets/documentwidget.h
Expand Up @@ -78,6 +78,7 @@ class DocumentWidget : public ScrollAreaWidget
void glInit();
void glDeinit();
void glMakeGeometry(DefaultVertexBuf::Builder &verts);
void updateStyle();

private:
DENG2_PRIVATE(d)
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -152,6 +152,7 @@ public IGameChangeObserver
QFile file("/Users/jaakko/Projects/deng/doomsday/client/src/ui/widgets/documentwidget.cpp");
file.open(QFile::ReadOnly);
doc->setText(QString::fromUtf8(file.readAll()));
doc->setFont("monospace");
//doc->setWidthPolicy(ui::Fixed);
doc->set(GuiWidget::Background(Vector4f(0, 0, 1, .5f)));
doc->rule()
Expand Down
10 changes: 9 additions & 1 deletion doomsday/client/src/ui/widgets/documentwidget.cpp
Expand Up @@ -64,6 +64,8 @@ DENG2_OBSERVES(Atlas, Reposition)
void updateStyle()
{
wraps.setFont(self.font());
wraps.clear();
self.requestGeometry();
}

void glInit()
Expand Down Expand Up @@ -266,6 +268,12 @@ void DocumentWidget::glDeinit()
void DocumentWidget::glMakeGeometry(DefaultVertexBuf::Builder &verts)
{
ScrollAreaWidget::glMakeGeometry(verts);

glMakeScrollIndicatorGeometry(verts, Vector2f(rule().left().value() + margin().value(),
rule().top().value() + margin().value()));
rule().top().value() + margin().value()));
}

void DocumentWidget::updateStyle()
{
d->updateStyle();
}

0 comments on commit 4600b54

Please sign in to comment.