Show a playing/pause icon on the active tab
This commit is contained in:
parent
1572124962
commit
7e913fb38b
|
@ -109,6 +109,29 @@ void PlaylistContainer::SetViewModel(Playlist* playlist) {
|
|||
emit UndoRedoActionsChanged(undo_, redo_);
|
||||
}
|
||||
|
||||
void PlaylistContainer::ActivePlaying() {
|
||||
UpdateActiveIcon(QIcon(":tiny-start.png"));
|
||||
}
|
||||
|
||||
void PlaylistContainer::ActivePaused() {
|
||||
UpdateActiveIcon(QIcon(":tiny-pause.png"));
|
||||
}
|
||||
|
||||
void PlaylistContainer::ActiveStopped() {
|
||||
UpdateActiveIcon(QIcon());
|
||||
}
|
||||
|
||||
void PlaylistContainer::UpdateActiveIcon(const QIcon& icon) {
|
||||
// Unset all existing icons
|
||||
for (int i=0 ; i<ui_->tab_bar->count() ; ++i) {
|
||||
ui_->tab_bar->setTabIcon(i, QIcon());
|
||||
}
|
||||
|
||||
// Set our icon
|
||||
if (!icon.isNull())
|
||||
ui_->tab_bar->setTabIcon(manager_->active_index(), icon);
|
||||
}
|
||||
|
||||
void PlaylistContainer::PlaylistAdded(int index, const QString &name) {
|
||||
ui_->tab_bar->insertTab(index, name);
|
||||
}
|
||||
|
|
|
@ -56,6 +56,13 @@ private slots:
|
|||
void PlaylistRemoved(int index);
|
||||
void PlaylistRenamed(int index, const QString& new_name);
|
||||
|
||||
void ActivePlaying();
|
||||
void ActivePaused();
|
||||
void ActiveStopped();
|
||||
|
||||
private:
|
||||
void UpdateActiveIcon(const QIcon& icon);
|
||||
|
||||
private:
|
||||
Ui_PlaylistContainer* ui_;
|
||||
|
||||
|
|
|
@ -250,6 +250,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||
connect(player_, SIGNAL(Paused()), ui_->playlist->view(), SLOT(StopGlowing()));
|
||||
connect(player_, SIGNAL(Playing()), ui_->playlist->view(), SLOT(StartGlowing()));
|
||||
connect(player_, SIGNAL(Stopped()), ui_->playlist->view(), SLOT(StopGlowing()));
|
||||
connect(player_, SIGNAL(Paused()), ui_->playlist, SLOT(ActivePaused()));
|
||||
connect(player_, SIGNAL(Playing()), ui_->playlist, SLOT(ActivePlaying()));
|
||||
connect(player_, SIGNAL(Stopped()), ui_->playlist, SLOT(ActiveStopped()));
|
||||
|
||||
connect(player_, SIGNAL(Paused()), osd_, SLOT(Paused()));
|
||||
connect(player_, SIGNAL(Stopped()), osd_, SLOT(Stopped()));
|
||||
|
|
Loading…
Reference in New Issue