Start tweaking alignments to make look a little better and take up proper spacing.
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
#include "../GroovePlayer.h"
|
#include "../GroovePlayer.h"
|
||||||
#include <grooveplayer/player.h>
|
#include <grooveplayer/player.h>
|
||||||
#include <Wt/WLength>
|
#include <Wt/WLength>
|
||||||
|
#include <Wt/WColor>
|
||||||
|
#include <Wt/WBorder>
|
||||||
|
|
||||||
PlayerInterface::PlayerInterface(WebInterface* app)
|
PlayerInterface::PlayerInterface(WebInterface* app)
|
||||||
{
|
{
|
||||||
@@ -30,8 +32,11 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
|||||||
this->setLayout(interfaceLayout);
|
this->setLayout(interfaceLayout);
|
||||||
playControlLayout = new Wt::WHBoxLayout();
|
playControlLayout = new Wt::WHBoxLayout();
|
||||||
voteControlLayout = new Wt::WVBoxLayout();
|
voteControlLayout = new Wt::WVBoxLayout();
|
||||||
|
playControlWidget = new Wt::WContainerWidget();
|
||||||
|
playControlWidget->setLayout(playControlLayout);
|
||||||
|
|
||||||
currentTrackProgress = new Wt::WProgressBar();
|
currentTrackProgress = new Wt::WProgressBar();
|
||||||
|
currentTrackProgress->decorationStyle().setBackgroundColor(Wt::WColor("#B20A5E"));
|
||||||
currentTrackProgress->setFormat("");
|
currentTrackProgress->setFormat("");
|
||||||
trackProgress = new Wt::WTimer();
|
trackProgress = new Wt::WTimer();
|
||||||
trackProgress->setInterval(1000);
|
trackProgress->setInterval(1000);
|
||||||
@@ -43,10 +48,12 @@ PlayerInterface::PlayerInterface(WebInterface* app)
|
|||||||
isPaused = groove_playlist_playing(GroovePlayerMgr::getInstance()->currentPlaylist)==0;
|
isPaused = groove_playlist_playing(GroovePlayerMgr::getInstance()->currentPlaylist)==0;
|
||||||
playpause->clicked().connect(this, &PlayerInterface::playpauseClicked);
|
playpause->clicked().connect(this, &PlayerInterface::playpauseClicked);
|
||||||
|
|
||||||
interfaceLayout->addLayout(playControlLayout);
|
interfaceLayout->addWidget(playControlWidget);
|
||||||
interfaceLayout->addWidget(currentTrackProgress);
|
interfaceLayout->addWidget(currentTrackProgress);
|
||||||
interfaceLayout->addLayout(voteControlLayout);
|
interfaceLayout->addLayout(voteControlLayout);
|
||||||
playControlLayout->addWidget(playpause,0,Wt::AlignmentFlag::AlignCenter | Wt::AlignmentFlag::AlignMiddle);
|
playControlWidget->decorationStyle().setBorder(Wt::WBorder::Outset);
|
||||||
|
playControlWidget->decorationStyle().setBackgroundColor(Wt::WColor("#00B200"));
|
||||||
|
playControlLayout->addWidget(playpause,0,Wt::AlignmentFlag::AlignLeft | Wt::AlignmentFlag::AlignMiddle);
|
||||||
playControlLayout->addWidget(currentTrackDetails);
|
playControlLayout->addWidget(currentTrackDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
|
|
||||||
Wt::WVBoxLayout* interfaceLayout;
|
Wt::WVBoxLayout* interfaceLayout;
|
||||||
Wt::WHBoxLayout* playControlLayout;
|
Wt::WHBoxLayout* playControlLayout;
|
||||||
|
Wt::WContainerWidget* playControlWidget;
|
||||||
Wt::WVBoxLayout* voteControlLayout;
|
Wt::WVBoxLayout* voteControlLayout;
|
||||||
|
|
||||||
//Play controls
|
//Play controls
|
||||||
|
|||||||
@@ -19,26 +19,32 @@
|
|||||||
|
|
||||||
#include "TrackDetails.h"
|
#include "TrackDetails.h"
|
||||||
#include <Wt/WLength>
|
#include <Wt/WLength>
|
||||||
|
#include <Wt/WCssDecorationStyle>
|
||||||
|
|
||||||
TrackDetails::TrackDetails()
|
TrackDetails::TrackDetails()
|
||||||
{
|
{
|
||||||
|
this->setMaximumSize(Wt::WLength(600, Wt::WLength::Pixel),Wt::WLength(200, Wt::WLength::Pixel));
|
||||||
|
this->decorationStyle().setBorder(Wt::WBorder::Ridge);
|
||||||
|
this->decorationStyle().setBackgroundColor(Wt::WColor("#6FFF6F"));
|
||||||
mainLayout = new Wt::WHBoxLayout();
|
mainLayout = new Wt::WHBoxLayout();
|
||||||
this->setLayout(mainLayout);
|
this->setLayout(mainLayout);
|
||||||
metaContainer = new Wt::WContainerWidget();
|
|
||||||
metaLayout = new Wt::WVBoxLayout();
|
metaLayout = new Wt::WVBoxLayout();
|
||||||
metaContainer->setLayout(metaLayout);
|
|
||||||
coverData = new Wt::WMemoryResource();
|
coverData = new Wt::WMemoryResource();
|
||||||
albumCover = new Wt::WImage();
|
albumCover = new Wt::WImage();
|
||||||
albumCover->setMinimumSize(Wt::WLength(100,Wt::WLength::Pixel),Wt::WLength(100,Wt::WLength::Pixel));
|
albumCover->setMinimumSize(Wt::WLength(100,Wt::WLength::Pixel),Wt::WLength(100,Wt::WLength::Pixel));
|
||||||
albumCover->setMaximumSize(Wt::WLength(200,Wt::WLength::Pixel),Wt::WLength(200,Wt::WLength::Pixel));
|
albumCover->setMaximumSize(Wt::WLength(200,Wt::WLength::Pixel),Wt::WLength(200,Wt::WLength::Pixel));
|
||||||
mainLayout->addWidget(albumCover);
|
mainLayout->addWidget(albumCover);
|
||||||
mainLayout->addWidget(metaContainer);
|
mainLayout->addSpacing(Wt::WLength(20, Wt::WLength::Pixel));
|
||||||
|
mainLayout->addLayout(metaLayout);
|
||||||
trackTitle = new Wt::WText();
|
trackTitle = new Wt::WText();
|
||||||
|
trackTitle->decorationStyle().setTextDecoration(Wt::WCssDecorationStyle::Underline);
|
||||||
|
trackTitle->decorationStyle().font().setSize(Wt::WFont::Size::Large);
|
||||||
|
trackTitle->decorationStyle().font().setWeight(Wt::WFont::Weight::Bold);
|
||||||
trackArtist = new Wt::WText();
|
trackArtist = new Wt::WText();
|
||||||
trackAlbum = new Wt::WText();
|
trackAlbum = new Wt::WText();
|
||||||
metaLayout->addWidget(trackTitle);
|
metaLayout->addWidget(trackTitle,2);
|
||||||
metaLayout->addWidget(trackArtist);
|
metaLayout->addWidget(trackAlbum,1,Wt::AlignmentFlag::AlignBottom);
|
||||||
metaLayout->addWidget(trackAlbum);
|
metaLayout->addWidget(trackArtist,1,Wt::AlignmentFlag::AlignBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackDetails::updateWithTrackDetails(AudioTrack track)
|
void TrackDetails::updateWithTrackDetails(AudioTrack track)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class TrackDetails : public Wt::WContainerWidget
|
|||||||
public:
|
public:
|
||||||
TrackDetails();
|
TrackDetails();
|
||||||
Wt::WHBoxLayout* mainLayout;
|
Wt::WHBoxLayout* mainLayout;
|
||||||
Wt::WContainerWidget* metaContainer;
|
|
||||||
Wt::WVBoxLayout* metaLayout;
|
Wt::WVBoxLayout* metaLayout;
|
||||||
|
|
||||||
Wt::WImage* albumCover;
|
Wt::WImage* albumCover;
|
||||||
|
|||||||
Reference in New Issue
Block a user