Skip to content

Commit

Permalink
Refactor|libappfw|Client: ScalarRule was renamed to AnimationRule
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 22, 2016
1 parent af25ab9 commit 7f7a12c
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/home/homewidget.cpp
Expand Up @@ -68,7 +68,7 @@ DENG_GUI_PIMPL(HomeWidget)
TabWidget *tabs;
SafeWidgetPtr<FadeToBlackWidget> blanker;
int currentOffsetTab = 0;
ScalarRule *scrollOffset;
AnimationRule *scrollOffset;
ButtonWidget *moveLeft;
ButtonWidget *moveRight;
ButtonWidget *taskBarHintButton;
Expand All @@ -83,7 +83,7 @@ DENG_GUI_PIMPL(HomeWidget)
DoomsdayApp::app().audienceForGameUnload() += this;

columnWidth = new IndirectRule;
scrollOffset = new ScalarRule(0);
scrollOffset = new AnimationRule(0);
scrollOffset->setStyle(Animation::EaseOut);

tabs = new TabWidget;
Expand Down
14 changes: 7 additions & 7 deletions doomsday/apps/client/src/ui/widgets/consolewidget.cpp
Expand Up @@ -34,7 +34,7 @@
#include <de/PersistentState>
#include <de/PopupButtonWidget>
#include <de/PopupMenuWidget>
#include <de/ScalarRule>
#include <de/AnimationRule>
#include <de/ScriptCommandWidget>
#include <de/SignalAction>
#include <de/ToggleWidget>
Expand All @@ -60,9 +60,9 @@ DENG_GUI_PIMPL(ConsoleWidget)
ConsoleCommandWidget *cmdLine = nullptr;
ScriptCommandWidget *scriptCmd = nullptr;
LogWidget *log = nullptr;
ScalarRule *horizShift;
ScalarRule *height;
ScalarRule *width;
AnimationRule *horizShift;
AnimationRule *height;
AnimationRule *width;
StyledLogSinkFormatter formatter;
bool opened = true;
bool scriptMode = false;
Expand All @@ -79,9 +79,9 @@ DENG_GUI_PIMPL(ConsoleWidget)

Instance(Public *i) : Base(i)
{
horizShift = new ScalarRule(0);
width = new ScalarRule(rule("console.width").valuei());
height = new ScalarRule(0);
horizShift = new AnimationRule(0);
width = new AnimationRule(rule("console.width").valuei());
height = new AnimationRule(0);

grabWidth = rule("gap").valuei();

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp
Expand Up @@ -93,7 +93,7 @@ DENG_GUI_PIMPL(HomeItemWidget)
LabelWidget *icon;
LabelWidget *label;
QList<ButtonWidget *> buttons;
ScalarRule *labelRightMargin;
AnimationRule *labelRightMargin;
Rule const *buttonsWidth = nullptr;
bool selected = false;
DotPath bgColor { "transparent" };
Expand All @@ -104,7 +104,7 @@ DENG_GUI_PIMPL(HomeItemWidget)

Instance(Public *i) : Base(i)
{
labelRightMargin = new ScalarRule(0);
labelRightMargin = new AnimationRule(0);

self.add(background = new LabelWidget);
self.add(icon = new LabelWidget);
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp
Expand Up @@ -54,7 +54,7 @@
#include <de/GLBuffer>
#include <de/KeyEvent>
#include <de/PopupMenuWidget>
#include <de/ScalarRule>
#include <de/AnimationRule>
#include <de/SequentialLayout>
#include <de/SignalAction>
#include <de/ui/SubwidgetItem>
Expand Down Expand Up @@ -112,7 +112,7 @@ DENG_GUI_PIMPL(TaskBarWidget)
PopupMenuWidget *configMenu;
MultiplayerMenuWidget *multiMenu;

ScalarRule *vertShift;
AnimationRule *vertShift;
bool mouseWasTrappedWhenOpening;
int minSpace;
int maxSpace;
Expand Down Expand Up @@ -140,7 +140,7 @@ DENG_GUI_PIMPL(TaskBarWidget)
uColor = Vector4f(1, 1, 1, 1);
self.set(Background(style().colors().colorf("background")));

vertShift = new ScalarRule(0);
vertShift = new AnimationRule(0);

DoomsdayApp::app().audienceForGameChange() += this;
ClientApp::serverLink().audienceForJoin += this;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/sdk/libappfw/include/de/widgets/scrollareawidget.h
Expand Up @@ -78,8 +78,8 @@ class LIBAPPFW_PUBLIC ScrollAreaWidget : public GuiWidget

RuleRectangle const &contentRule() const;

ScalarRule &scrollPositionX() const;
ScalarRule &scrollPositionY() const;
AnimationRule &scrollPositionX() const;
AnimationRule &scrollPositionY() const;
Rule const &maximumScrollX() const;
Rule const &maximumScrollY() const;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/sdk/libappfw/src/widgets/labelwidget.cpp
Expand Up @@ -55,7 +55,7 @@ public Font::RichFormat::IStyle

ConstantRule *width;
ConstantRule *height;
ScalarRule *appearSize;
AnimationRule *appearSize;
LabelWidget::AppearanceAnimation appearType;
TimeDelta appearSpan;

Expand Down Expand Up @@ -93,7 +93,7 @@ public Font::RichFormat::IStyle
, imageColor (1, 1, 1, 1)
, textGLColor (1, 1, 1, 1)
, maxTextWidth(0)
, appearSize (new ScalarRule(0))
, appearSize (new AnimationRule(0))
, appearType (AppearInstantly)
, appearSpan (0.0)
, gapId ("label.gap")
Expand Down
6 changes: 3 additions & 3 deletions doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp
Expand Up @@ -25,7 +25,7 @@

#include <de/KeyEvent>
#include <de/MouseEvent>
#include <de/ScalarRule>
#include <de/AnimationRule>
#include <de/Drawable>

namespace de {
Expand All @@ -40,7 +40,7 @@ DENG_GUI_PIMPL(LineEditWidget)
{
typedef GLBufferT<Vertex2TexRgba> VertexBuf;

ScalarRule *height;
AnimationRule *height;
FontLineWrapping &wraps;
LabelWidget *hint;
bool signalOnEnter;
Expand Down Expand Up @@ -70,7 +70,7 @@ DENG_GUI_PIMPL(LineEditWidget)
, uColor ("uColor", GLUniform::Vec4)
, uCursorColor("uColor", GLUniform::Vec4)
{
height = new ScalarRule(0);
height = new AnimationRule(0);

self.setFont("editor.plaintext");
updateStyle();
Expand Down
6 changes: 3 additions & 3 deletions doomsday/sdk/libappfw/src/widgets/notificationareawidget.cpp
Expand Up @@ -22,7 +22,7 @@

#include <de/Drawable>
#include <de/Matrix>
#include <de/ScalarRule>
#include <de/AnimationRule>

#include <QMap>
#include <QTimer>
Expand All @@ -34,7 +34,7 @@ static TimeDelta const ANIM_SPAN = .5;
DENG_GUI_PIMPL(NotificationAreaWidget)
, DENG2_OBSERVES(Widget, Deletion)
{
ScalarRule *shift;
AnimationRule *shift;
QMap<GuiWidget *, RelayWidget *> shown;

QTimer dismissTimer;
Expand All @@ -46,7 +46,7 @@ DENG_GUI_PIMPL(NotificationAreaWidget)
dismissTimer.setInterval(ANIM_SPAN.asMilliSeconds());
QObject::connect(&dismissTimer, SIGNAL(timeout()), thisPublic, SLOT(dismiss()));

shift = new ScalarRule(0);
shift = new AnimationRule(0);
}

~Instance()
Expand Down
6 changes: 3 additions & 3 deletions doomsday/sdk/libappfw/src/widgets/panelwidget.cpp
Expand Up @@ -21,7 +21,7 @@

#include <de/Drawable>
#include <de/MouseEvent>
#include <de/ScalarRule>
#include <de/AnimationRule>
#include <de/math.h>

#include <QTimer>
Expand All @@ -40,7 +40,7 @@ DENG_GUI_PIMPL(PanelWidget)
ui::Direction dir = ui::Down;
ui::SizePolicy secondaryPolicy = ui::Expand;
GuiWidget *content = nullptr;
ScalarRule *openingRule;
AnimationRule *openingRule;
QTimer dismissTimer;

QScopedPointer<AssetGroup> pendingShow;
Expand All @@ -51,7 +51,7 @@ DENG_GUI_PIMPL(PanelWidget)

Instance(Public *i) : Base(i)
{
openingRule = new ScalarRule(0);
openingRule = new AnimationRule(0);

dismissTimer.setSingleShot(true);
QObject::connect(&dismissTimer, SIGNAL(timeout()), thisPublic, SLOT(dismiss()));
Expand Down
2 changes: 1 addition & 1 deletion doomsday/sdk/libappfw/src/widgets/popupwidget.cpp
Expand Up @@ -24,7 +24,7 @@

#include <de/Drawable>
#include <de/MouseEvent>
#include <de/ScalarRule>
#include <de/AnimationRule>
#include <de/Garbage>
#include <de/math.h>
#include <QTimer>
Expand Down
12 changes: 6 additions & 6 deletions doomsday/sdk/libappfw/src/widgets/scrollareawidget.cpp
Expand Up @@ -37,8 +37,8 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable
*/
RuleRectangle contentRule;

ScalarRule *x;
ScalarRule *y;
AnimationRule *x;
AnimationRule *y;
Rule *maxX;
Rule *maxY;

Expand Down Expand Up @@ -75,8 +75,8 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable

updateStyle();

x = new ScalarRule(0);
y = new ScalarRule(0);
x = new AnimationRule(0);
y = new AnimationRule(0);

maxX = new OperatorRule(OperatorRule::Maximum, Const(0),
contentRule.width() - self.rule().width() + self.margins().width());
Expand Down Expand Up @@ -264,12 +264,12 @@ RuleRectangle const &ScrollAreaWidget::contentRule() const
return d->contentRule;
}

ScalarRule &ScrollAreaWidget::scrollPositionX() const
AnimationRule &ScrollAreaWidget::scrollPositionX() const
{
return *d->x;
}

ScalarRule &ScrollAreaWidget::scrollPositionY() const
AnimationRule &ScrollAreaWidget::scrollPositionY() const
{
return *d->y;
}
Expand Down
10 changes: 5 additions & 5 deletions doomsday/sdk/libappfw/src/widgets/tabwidget.cpp
Expand Up @@ -20,7 +20,7 @@
#include "de/ui/ListData"
#include "de/MenuWidget"

#include <de/ScalarRule>
#include <de/AnimationRule>

Q_DECLARE_METATYPE(de::ui::Item const *)

Expand All @@ -37,8 +37,8 @@ DENG_GUI_PIMPL(TabWidget)
bool needUpdate = false;
bool invertedStyle = false;
LabelWidget *selected = nullptr;
ScalarRule *selLeft = nullptr;
ScalarRule *selWidth = nullptr;
AnimationRule *selLeft = nullptr;
AnimationRule *selWidth = nullptr;

Instance(Public *i) : Base(i)
{
Expand Down Expand Up @@ -132,8 +132,8 @@ DENG_GUI_PIMPL(TabWidget)
{
// Initialize the animated rules for positioning the
// selection highlight.
selLeft = new ScalarRule(0);
selWidth = new ScalarRule(0);
selLeft = new AnimationRule(0);
selWidth = new AnimationRule(0);
selected->rule()
.setInput(Rule::Width, *selWidth)
.setInput(Rule::Left, *selLeft);
Expand Down

0 comments on commit 7f7a12c

Please sign in to comment.