Skip to content

Commit

Permalink
UI|Client|libappfw: Adjusted fold panel indicators
Browse files Browse the repository at this point in the history
Also, aligning the Reset buttons of the Renderer Appearance
sidebar vertically with the fold indicators.
  • Loading branch information
skyjake committed Feb 25, 2014
1 parent 7072dc9 commit d3ad0ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
11 changes: 6 additions & 5 deletions doomsday/client/src/ui/editors/rendererappearanceeditor.cpp
Expand Up @@ -111,13 +111,11 @@ DENG2_OBSERVES(App, GameChange)
_resetButton->setText(tr("Reset"));
_resetButton->setAction(new ResetAction(this));
_resetButton->rule()
.setInput(Rule::Right, d->container->contentRule().right())
.setInput(Rule::Top, title().rule().top());
.setInput(Rule::Right, d->container->contentRule().right())
.setInput(Rule::AnchorY, title().rule().top() + title().rule().height() / 2)
.setAnchorPoint(Vector2f(0, .5f));
_resetButton->disable();

// Extend the title all the way to the button.
title().hitRule().setInput(Rule::Right, _resetButton->rule().left());

d->container->add(&title());
d->container->add(_resetButton);
d->container->add(this);
Expand Down Expand Up @@ -192,6 +190,9 @@ DENG2_OBSERVES(App, GameChange)
{
_group->rule().setSize(_layout.width(), _layout.height());

// Extend the title all the way to the button.
title().rule().setInput(Rule::Right, _resetButton->rule().left());

// Calculate the maximum rule for the first column items.
for(int i = 0; i < _layout.gridSize().y; ++i)
{
Expand Down
10 changes: 2 additions & 8 deletions doomsday/libappfw/src/widgets/foldpanelwidget.cpp
Expand Up @@ -79,20 +79,14 @@ ButtonWidget *FoldPanelWidget::makeTitle(String const &text)
d->title->setTextColor("accent");
d->title->setHoverTextColor("text", ButtonWidget::ReplaceColor);
d->title->setFont("heading");
d->title->setAlignment(ui::AlignLeft);
d->title->setTextLineAlignment(ui::AlignLeft);
d->title->set(Background()); // no frame or background
d->title->setAction(new SignalAction(this, SLOT(toggleFold())));
d->title->setOpacity(.8f);

// Fold indicator.
d->title->setImage(new Instance::FoldImage(*this));
d->title->setAlignment(ui::AlignCenter, LabelWidget::AlignSeparately);
d->title->setTextAlignment(ui::AlignLeft);
d->title->setImageAlignment(ui::AlignRight);
d->title->setTextGap("gap");

// By default, make the button as wide as the fold panel.
d->title->rule().setInput(Rule::Width, rule().width());
d->title->setOverlayImage(new Instance::FoldImage(*this), ui::AlignRight);

return d->title;
}
Expand Down

0 comments on commit d3ad0ce

Please sign in to comment.