Skip to content

Commit

Permalink
WTrackMenu: show Properties shortcut when invoked from tracks table
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Oct 2, 2021
1 parent 0c58377 commit a2e5373
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ void WTrackMenu::createActions() {

if (featureIsEnabled(Feature::Properties)) {
m_pPropertiesAct = new QAction(tr("Properties"), this);
// This is just for having the shortcut displayed next to the action
// when the menu is invoked from the tracks table.
// The actual shortcut is set in WTrackTableView::keyPressEvent
if (m_pTrackModel) {
m_pPropertiesAct->setShortcut(QKeySequence(tr("Ctrl+Return")));
}
connect(m_pPropertiesAct, &QAction::triggered, this, &WTrackMenu::slotShowDlgTrackInfo);
}

Expand Down
1 change: 1 addition & 0 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ TrackModel* WTrackTableView::getTrackModel() const {
void WTrackTableView::keyPressEvent(QKeyEvent* event) {
if (event->key() == Qt::Key_Return) {
// Ctrl+Enter opens track properties dialog
// The shortcut display string needs to be set in WTrackMenu accordingly.
if (event->modifiers() & Qt::ControlModifier) {
QModelIndexList indices = selectionModel()->selectedRows();
if (indices.length() == 1) {
Expand Down

0 comments on commit a2e5373

Please sign in to comment.