Add interface class to represent player interface. Have simple hide/show animation between. Put up more interface elements on login interface to show inteded ui.

This commit is contained in:
Kevin Whitaker
2017-01-28 16:51:14 -05:00
parent 93e095d46e
commit 22f1b90238
7 changed files with 115 additions and 5 deletions

View File

@@ -19,24 +19,39 @@
#include "WebInterface.h"
#include "ui/LoginInterface.h"
#include "ui/PlayerInterface.h"
#include <Wt/WText>
#include <Wt/WAnimation>
struct WebInterface::internal
{
LoginInterface* loginUI;
PlayerInterface* playerUI;
};
WebInterface::WebInterface(const Wt::WEnvironment& env) : Wt::WApplication(env)
{
priv_int = new internal;
setTitle("Arbitrateor - Audio Jukebox");
priv_int->playerUI = new PlayerInterface(this);
priv_int->playerUI->hide();
priv_int->loginUI = new LoginInterface(this);
priv_int->loginUI->animateShow(Wt::WAnimation(Wt::WAnimation::AnimationEffect::SlideInFromTop));
root()->addWidget(priv_int->playerUI);
root()->addWidget(priv_int->loginUI);
}
WebInterface::~WebInterface()
{
delete priv_int->playerUI;
delete priv_int->loginUI;
delete priv_int;
}
void WebInterface::loginCompleted()
{
//Login completed, now bring up main inteface.
root()->removeWidget(priv_int->loginUI);
root()->addWidget(new Wt::WText("you did it"));
priv_int->loginUI->animateHide(Wt::WAnimation(Wt::WAnimation::AnimationEffect::Fade));
priv_int->playerUI->animateShow(Wt::WAnimation(Wt::WAnimation::AnimationEffect::Fade, Wt::WAnimation::TimingFunction::EaseIn, 500));
//TODO: set up player to dynamically update?
}