Continuation of "Seek instead of navigation with arrow keys" #5550, now allows up arrow key. (#5721)

* Continuation of "Seek instead of navigation with arrow keys" #5550, now allows up arrow key to not restart the song over when the library is in focus. Works as usuhal when playlist is in focus (song gets started over).

* Update playlistview.cpp

Added in the part that is responsible for seeking properly.
This commit is contained in:
Grace Dolphy 2017-05-30 13:19:08 -04:00 committed by John Maguire
parent 8ff7d5750c
commit bdda50b28f
2 changed files with 6 additions and 6 deletions

View File

@ -67,10 +67,10 @@ PlaylistContainer::PlaylistContainer(QWidget* parent)
no_matches_palette.setColor(QPalette::Inactive, QPalette::WindowText,
no_matches_color);
no_matches_label_->setPalette(no_matches_palette);
// Remove QFrame border
ui_->toolbar->setStyleSheet("QFrame { border: 0px; }");
// Make it bold
QFont no_matches_font = no_matches_label_->font();
no_matches_font.setBold(true);
@ -273,9 +273,7 @@ void PlaylistContainer::PlaylistAdded(int id, const QString& name,
}
}
void PlaylistContainer::Started() {
starting_up_ = false;
}
void PlaylistContainer::Started() { starting_up_ = false; }
void PlaylistContainer::PlaylistClosed(int id) {
ui_->tab_bar->RemoveTab(id);
@ -436,7 +434,6 @@ bool PlaylistContainer::eventFilter(QObject* objectWatched, QEvent* event) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent* e = static_cast<QKeyEvent*>(event);
switch (e->key()) {
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_PageUp:
case Qt::Key_PageDown:

View File

@ -616,6 +616,9 @@ void PlaylistView::keyPressEvent(QKeyEvent* event) {
event->key() == Qt::Key_Space) {
emit PlayPause();
event->accept();
} else if (event->key() == Qt::Key_Up) {
app_->player()->SeekTo(0);
event->accept();
} else if (event->key() == Qt::Key_Left) {
emit SeekBackward();
event->accept();