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:
@@ -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?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user