Skip to content

Commit

Permalink
audqt: Add Shift+Enter shortcut to Jump-to-Song dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed Oct 30, 2023
1 parent f1d2c66 commit 9b78e85
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/libaudqt/song-window-qt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <QFrame>
#include <QHeaderView>
#include <QItemSelectionModel>
#include <QKeyEvent>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
Expand Down Expand Up @@ -245,6 +246,9 @@ class SongsWindow : public QDialog
delete instance;
}

protected:
void keyPressEvent(QKeyEvent * event) override;

private:
static SongsWindow * instance;
SongListModel m_songListModel;
Expand Down Expand Up @@ -378,6 +382,17 @@ SongsWindow::SongsWindow()
resize(500, 500);
}

void SongsWindow::keyPressEvent(QKeyEvent * event)
{
if (event->key() == Qt::Key_Return && event->modifiers() == Qt::ShiftModifier)
{
// Let Shift+Enter act as another shortcut for the Queue button
this->m_queueAndUnqueueButton.animateClick();
}

QDialog::keyPressEvent(event);
}

EXPORT void songwin_show()
{
window_bring_to_front(SongsWindow::get_instance());
Expand Down

0 comments on commit 9b78e85

Please sign in to comment.