Commit 8c8a6c30 authored by Kevin Whitaker's avatar Kevin Whitaker

Set up basic request layout to fill with logic.

parent c6c2ecce
......@@ -22,5 +22,31 @@
RequestInterface::RequestInterface(WebInterface* app)
{
this->app = app;
mainLayout = new Wt::WVBoxLayout();
searchHeader = new Wt::WContainerWidget();
searchLayout = new Wt::WHBoxLayout();
searchBox = new Wt::WLineEdit();
searchBtn = new Wt::WPushButton();
resultBody = new Wt::WContainerWidget();
resultLayout = new Wt::WGridLayout();
this->setLayout(mainLayout);
mainLayout->addWidget(searchHeader,0,Wt::AlignmentFlag::AlignCenter);
mainLayout->addWidget(resultBody);
searchHeader->setLayout(searchLayout);
searchBtn->setTextFormat(Wt::XHTMLText);
searchBtn->decorationStyle().font().setFamily(Wt::WFont::Default,"FontAwesome");
searchBtn->setText("");
searchLayout->addWidget(searchBox);
searchLayout->addWidget(searchBtn);
//TODO:btn connections
resultBody->setLayout(resultLayout);
}
void RequestInterface::trackRequestClicked(AudioTrack track)
{
//TODO
}
......@@ -22,6 +22,12 @@
#include <Wt/WContainerWidget>
#include "../WebInterface.h"
#include <Wt/WPushButton>
#include <Wt/WHBoxLayout>
#include <Wt/WVBoxLayout>
#include <Wt/WGridLayout>
#include <Wt/WLineEdit>
#include "TrackDetails.h"
class RequestInterface : public Wt::WContainerWidget
{
......@@ -29,8 +35,42 @@ public:
RequestInterface(WebInterface* app);
WebInterface* app;
class RequestItem : public Wt::WContainerWidget
{
public:
TrackDetails* track;
Wt::WHBoxLayout* layout;
Wt::WPushButton* voteBtn;
RequestInterface* parent;
void requestClicked() {
this->parent->trackRequestClicked(track->extractTrackFromDetails());
};
RequestItem(RequestInterface* parent, AudioTrack track) {
this->track = new TrackDetails();
this->track->updateWithTrackDetails(track);
layout = new Wt::WHBoxLayout();
voteBtn = new Wt::WPushButton();
this->parent = parent;
this->setLayout(layout);
voteBtn->setTextFormat(Wt::XHTMLText);
voteBtn->decorationStyle().font().setFamily(Wt::WFont::Default,"FontAwesome");
voteBtn->setText("&#61525;");
layout->addWidget(this->track,1,Wt::AlignmentFlag::AlignMiddle | Wt::AlignmentFlag::AlignLeft);
layout->addWidget(voteBtn,0,Wt::AlignmentFlag::AlignMiddle | Wt::AlignmentFlag::AlignRight);
voteBtn->clicked().connect(this, &RequestItem::requestClicked);
};
};
Wt::WVBoxLayout* mainLayout;
Wt::WContainerWidget* searchHeader;
Wt::WHBoxLayout* searchLayout;
Wt::WLineEdit* searchBox;
Wt::WPushButton* searchBtn;
Wt::WContainerWidget* resultBody;
Wt::WGridLayout* resultLayout;
void trackRequestClicked(AudioTrack track);
};
#endif // REQUESTINTERFACE_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment