Refactor things so less manual layout is done where not needed. Yields proper boostrap panel.
This commit is contained in:
@@ -32,7 +32,6 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
||||
interfaceLayout = new Wt::WVBoxLayout();
|
||||
this->setLayout(interfaceLayout);
|
||||
playControlLayout = new Wt::WHBoxLayout();
|
||||
voteControlLayout = new Wt::WVBoxLayout();
|
||||
playControlWidget = new Wt::WContainerWidget();
|
||||
skipControls = new Wt::WContainerWidget();
|
||||
playControlWidget->setLayout(playControlLayout);
|
||||
@@ -67,16 +66,15 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
||||
skipControls->addWidget(skipDeny);
|
||||
|
||||
mainDisplay = new Wt::WTabWidget();
|
||||
requestPane = new RequestInterface(app);
|
||||
|
||||
voteMetaContainer = new Wt::WContainerWidget();
|
||||
voteMetaLayout = new Wt::WVBoxLayout();
|
||||
voteMetaContainer->setLayout(voteMetaLayout);
|
||||
voteControlContainer = new Wt::WContainerWidget();
|
||||
voteControlContainer->setMaximumSize(Wt::WLength(75,Wt::WLength::Percentage),Wt::WLength::Auto);
|
||||
voteControlContainer->decorationStyle().setBackgroundColor(Wt::WColor("lightsteelblue"));
|
||||
voteControlContainer->addStyleClass("panel");
|
||||
voteHeader = new Wt::WText("Upcoming Tracks To Vote On");
|
||||
voteHeader->addStyleClass("panel-heading");
|
||||
votePanel = new Wt::WPanel();
|
||||
votePanel->addStyleClass("panel-primary");
|
||||
voteTracksContainer = new Wt::WContainerWidget();
|
||||
voteTracksContainer->addStyleClass("panel-body");
|
||||
voteTracksLayout = new Wt::WVBoxLayout();
|
||||
@@ -124,6 +122,7 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
||||
interfaceLayout->addWidget(currentTrackProgress);
|
||||
interfaceLayout->addWidget(mainDisplay);
|
||||
mainDisplay->addTab(voteMetaContainer,"Up Next",Wt::WTabWidget::PreLoading);
|
||||
mainDisplay->addTab(requestPane, "Make Request", Wt::WTabWidget::LazyLoading);
|
||||
playControlWidget->addStyleClass("panel");
|
||||
playControlWidget->addStyleClass("panel-default");
|
||||
playControlWidget->decorationStyle().setBackgroundColor(Wt::WColor("gainsboro"));
|
||||
@@ -131,9 +130,10 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
||||
playControlLayout->addWidget(playpause,0,Wt::AlignmentFlag::AlignLeft | Wt::AlignmentFlag::AlignMiddle);
|
||||
playControlLayout->addWidget(currentTrackDetails,0,Wt::AlignmentFlag::AlignCenter | Wt::AlignmentFlag::AlignMiddle);
|
||||
playControlLayout->addWidget(skipControls,0,Wt::AlignmentFlag::AlignRight | Wt::AlignmentFlag::AlignMiddle);
|
||||
voteControlContainer->setLayout(voteControlLayout);
|
||||
voteControlLayout->addWidget(voteHeader,0,Wt::AlignmentFlag::AlignCenter);
|
||||
voteControlLayout->addWidget(voteTracksContainer);
|
||||
votePanel->setTitle("Upcoming Tracks To Vote On");
|
||||
votePanel->decorationStyle().setBackgroundColor(Wt::WColor("lightsteelblue"));
|
||||
voteControlContainer->addWidget(votePanel);
|
||||
votePanel->setCentralWidget(voteTracksContainer);
|
||||
voteTracksContainer->setLayout(voteTracksLayout);
|
||||
voteTracksLayout->addLayout(track1);
|
||||
voteTracksLayout->addSpacing(Wt::WLength(20,Wt::WLength::Pixel));
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <Wt/WProgressBar>
|
||||
#include <Wt/WTimer>
|
||||
#include "TrackDetails.h"
|
||||
#include "RequestInterface.h"
|
||||
#include <Wt/WPanel>
|
||||
|
||||
class PlayerInterface : public Wt::WContainerWidget
|
||||
{
|
||||
@@ -40,7 +42,6 @@ public:
|
||||
Wt::WVBoxLayout* interfaceLayout;
|
||||
Wt::WHBoxLayout* playControlLayout;
|
||||
Wt::WContainerWidget* playControlWidget;
|
||||
Wt::WVBoxLayout* voteControlLayout;
|
||||
|
||||
//Play controls
|
||||
TrackDetails* currentTrackDetails;
|
||||
@@ -55,13 +56,14 @@ public:
|
||||
|
||||
//TabView
|
||||
Wt::WTabWidget* mainDisplay;
|
||||
RequestInterface* requestPane;
|
||||
|
||||
//Vote Controls
|
||||
Wt::WContainerWidget* voteMetaContainer;
|
||||
Wt::WVBoxLayout* voteMetaLayout;
|
||||
Wt::WPanel* votePanel;
|
||||
Wt::WContainerWidget* voteControlContainer;
|
||||
Wt::WContainerWidget* voteTracksContainer;
|
||||
Wt::WText* voteHeader;
|
||||
Wt::WVBoxLayout* voteTracksLayout;
|
||||
Wt::WHBoxLayout* track1;
|
||||
Wt::WHBoxLayout* track2;
|
||||
|
||||
@@ -18,3 +18,9 @@
|
||||
*/
|
||||
|
||||
#include "RequestInterface.h"
|
||||
|
||||
RequestInterface::RequestInterface(WebInterface* app)
|
||||
{
|
||||
this->app = app;
|
||||
//TODO
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ class RequestInterface : public Wt::WContainerWidget
|
||||
public:
|
||||
RequestInterface(WebInterface* app);
|
||||
WebInterface* app;
|
||||
|
||||
Wt::WContainerWidget* searchHeader;
|
||||
Wt::WContainerWidget* resultBody;
|
||||
};
|
||||
|
||||
#endif // REQUESTINTERFACE_H
|
||||
|
||||
Reference in New Issue
Block a user