Skip to content

Commit

Permalink
WTrackProperty/WTrackText: show DlgTrackInfo on double-click
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Aug 6, 2020
1 parent 3454734 commit bd57acc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ void WTrackProperty::mouseMoveEvent(QMouseEvent *event) {
DragAndDropHelper::dragTrack(m_pCurrentTrack, this, m_group);
}
}
void WTrackProperty::mouseDoubleClickEvent(QMouseEvent* 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
7 changes: 7 additions & 0 deletions src/widget/wtracktext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ void WTrackText::mouseMoveEvent(QMouseEvent *event) {
}
}

void WTrackText::mouseDoubleClickEvent(QMouseEvent* 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 bd57acc

Please sign in to comment.