[UI] Added clear button in the play queue. Corrected some style stuff too

This commit is contained in:
emeric
2014-12-21 14:42:41 +01:00
parent b1515a8847
commit d790a0cf76
4 changed files with 20 additions and 6 deletions
+7 -4
View File
@@ -44,6 +44,7 @@ _playQueue(nullptr)
{ {
Wt::WGridLayout *mainLayout = new Wt::WGridLayout(); Wt::WGridLayout *mainLayout = new Wt::WGridLayout();
this->setLayout(mainLayout); this->setLayout(mainLayout);
mainLayout->setContentsMargins(9,4,9,9);
// Filters // Filters
Wt::WHBoxLayout *filterLayout = new Wt::WHBoxLayout(); Wt::WHBoxLayout *filterLayout = new Wt::WHBoxLayout();
@@ -122,14 +123,16 @@ _playQueue(nullptr)
downBtn->setStyleClass("btn-sm"); downBtn->setStyleClass("btn-sm");
playlistControls->addWidget(downBtn); playlistControls->addWidget(downBtn);
Wt::WPushButton *delBtn = new Wt::WPushButton("DEL"); Wt::WPushButton *delBtn = new Wt::WPushButton("DEL");
delBtn->setStyleClass("btn-sm"); delBtn->setStyleClass("btn-sm btn-warning");
playlistControls->addWidget(delBtn); playlistControls->addWidget(delBtn);
Wt::WPushButton *clearBtn = new Wt::WPushButton("CLR");
clearBtn->setStyleClass("btn-sm btn-danger");
playlistControls->addWidget(clearBtn);
delBtn->clicked().connect(_playQueue, &PlayQueue::delSelected); delBtn->clicked().connect(_playQueue, &PlayQueue::delSelected);
upBtn->clicked().connect(_playQueue, &PlayQueue::moveSelectedUp); upBtn->clicked().connect(_playQueue, &PlayQueue::moveSelectedUp);
downBtn->clicked().connect(_playQueue, &PlayQueue::moveSelectedDown); downBtn->clicked().connect(_playQueue, &PlayQueue::moveSelectedDown);
clearBtn->clicked().connect(_playQueue, &PlayQueue::delAll);
playlistControls->addWidget(new Wt::WText("Duration:"), 1);
// Load menu // Load menu
{ {
@@ -160,7 +163,7 @@ _playQueue(nullptr)
mainLayout->setRowStretch(1, 1); mainLayout->setRowStretch(1, 1);
mainLayout->setRowResizable(0, true, Wt::WLength(200, Wt::WLength::Pixel)); mainLayout->setRowResizable(0, true, Wt::WLength(200, Wt::WLength::Pixel));
mainLayout->setColumnResizable(0, true, Wt::WLength(400, Wt::WLength::Pixel)); mainLayout->setColumnResizable(0, true, Wt::WLength(350, Wt::WLength::Pixel));
// Double click on track // Double click on track
// Set the selected tracks to the play queue // Set the selected tracks to the play queue
+6
View File
@@ -502,7 +502,13 @@ PlayQueue::delSelected(void)
_trackSelector->setSize(_model->rowCount()); _trackSelector->setSize(_model->rowCount());
renumber(minId, _model->rowCount() - 1); renumber(minId, _model->rowCount() - 1);
}
void
PlayQueue::delAll(void)
{
_model->removeRows(0, _model->rowCount());
_trackSelector->setSize(0);
} }
void void
+1
View File
@@ -53,6 +53,7 @@ class PlayQueue : public Wt::WTableView
// List manipulations // List manipulations
void delSelected(void); void delSelected(void);
void delAll(void);
void moveSelectedUp(void); void moveSelectedUp(void);
void moveSelectedDown(void); void moveSelectedDown(void);
+6 -2
View File
@@ -20,15 +20,19 @@ div.contents {
} }
.playqueue-playing { .playqueue-playing {
background-color: rgba(202, 167, 66, 1); background-color: #4A42CA;
} }
.Wt-tableview .playqueue-playing { .Wt-tableview .playqueue-playing {
color: #FFF; color: #FFF;
} }
.Wt-tableview div.playqueue-playing {
background-color: #4A42CA;
}
.Wt-tableview .Wt-tv-contents.Wt-striped div.playqueue-playing:nth-child(odd) { .Wt-tableview .Wt-tv-contents.Wt-striped div.playqueue-playing:nth-child(odd) {
background-color: rgba(202, 167, 66, 1); background-color: #4A42CA;
} }
.playqueue-track { .playqueue-track {