From c6c2eccec5399707cdf4f63922394ea5432818d3 Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Sun, 19 Feb 2017 16:40:33 -0500 Subject: [PATCH] Refactor things so less manual layout is done where not needed. Yields proper boostrap panel. --- src/ui/PlayerInterface.cpp | 16 ++++++++-------- src/ui/PlayerInterface.h | 6 ++++-- src/ui/RequestInterface.cpp | 6 ++++++ src/ui/RequestInterface.h | 3 +++ 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/ui/PlayerInterface.cpp b/src/ui/PlayerInterface.cpp index 8f18f99..f608afc 100644 --- a/src/ui/PlayerInterface.cpp +++ b/src/ui/PlayerInterface.cpp @@ -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)); diff --git a/src/ui/PlayerInterface.h b/src/ui/PlayerInterface.h index ab9e386..1f299ea 100644 --- a/src/ui/PlayerInterface.h +++ b/src/ui/PlayerInterface.h @@ -30,6 +30,8 @@ #include #include #include "TrackDetails.h" +#include "RequestInterface.h" +#include 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; diff --git a/src/ui/RequestInterface.cpp b/src/ui/RequestInterface.cpp index 3263885..8856ffe 100644 --- a/src/ui/RequestInterface.cpp +++ b/src/ui/RequestInterface.cpp @@ -18,3 +18,9 @@ */ #include "RequestInterface.h" + +RequestInterface::RequestInterface(WebInterface* app) +{ + this->app = app; + //TODO +} diff --git a/src/ui/RequestInterface.h b/src/ui/RequestInterface.h index 8febc1b..75ed664 100644 --- a/src/ui/RequestInterface.h +++ b/src/ui/RequestInterface.h @@ -28,6 +28,9 @@ class RequestInterface : public Wt::WContainerWidget public: RequestInterface(WebInterface* app); WebInterface* app; + + Wt::WContainerWidget* searchHeader; + Wt::WContainerWidget* resultBody; }; #endif // REQUESTINTERFACE_H -- GitLab