Skip to content

Commit

Permalink
Merge pull request #2990 from ronso0/quick-track-edit--2.3
Browse files Browse the repository at this point in the history
double-click WTrackProperty to open DlgTrackInfo
  • Loading branch information
Holzhaus authored Aug 10, 2020
2 parents 6d27f16 + 0cd8d95 commit 340d37e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget/wtrackmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class WTrackMenu : public QMenu {
// WARNING: This function hides non-virtual QMenu::popup().
// This has been done on purpose to ensure menu doesn't popup without loaded track(s).
void popup(const QPoint& pos, QAction* at = nullptr);
void slotShowTrackInfo();

signals:
void loadTrackToPlayer(TrackPointer pTrack, QString group, bool play = false);
Expand Down Expand Up @@ -97,7 +98,6 @@ class WTrackMenu : public QMenu {
void slotScaleBpm(int);

// Info and metadata
void slotShowTrackInfo();
void slotShowDlgTagFetcher();
void slotImportMetadataFromFileTags();
void slotExportMetadataIntoFileTags();
Expand Down
7 changes: 7 additions & 0 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ void WTrackProperty::mouseMoveEvent(QMouseEvent *event) {
DragAndDropHelper::dragTrack(m_pCurrentTrack, this, m_group);
}
}
void WTrackProperty::mouseDoubleClickEvent(QMouseEvent* event) {
Q_UNUSED(event);
if (m_pCurrentTrack) {
m_pTrackMenu->loadTrack(m_pCurrentTrack);
m_pTrackMenu->slotShowTrackInfo();
}
}

void WTrackProperty::dragEnterEvent(QDragEnterEvent *event) {
DragAndDropHelper::handleTrackDragEnterEvent(event, m_group, m_pConfig);
Expand Down
1 change: 1 addition & 0 deletions src/widget/wtrackproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class WTrackProperty : public WLabel, public TrackDropTarget {
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;

void updateLabel();

Expand Down
8 changes: 8 additions & 0 deletions src/widget/wtracktext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ void WTrackText::mouseMoveEvent(QMouseEvent *event) {
}
}

void WTrackText::mouseDoubleClickEvent(QMouseEvent* event) {
Q_UNUSED(event);
if (m_pCurrentTrack) {
m_pTrackMenu->loadTrack(m_pCurrentTrack);
m_pTrackMenu->slotShowTrackInfo();
}
}

void WTrackText::dragEnterEvent(QDragEnterEvent *event) {
DragAndDropHelper::handleTrackDragEnterEvent(event, m_group, m_pConfig);
}
Expand Down
1 change: 1 addition & 0 deletions src/widget/wtracktext.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class WTrackText : public WLabel, public TrackDropTarget {
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;

void updateLabel();

Expand Down

0 comments on commit 340d37e

Please sign in to comment.