diff options
author | Harshit Maurya <hmaurya999@gmail.com> | 2020-05-14 00:37:15 +0530 |
---|---|---|
committer | Harshit Maurya <hmaurya999@gmail.com> | 2020-05-16 02:17:43 +0530 |
commit | ad104313bd206d1f133d1270c4ee8a91eb162fe1 (patch) | |
tree | 129ff42b1ca6b7f31234f87fbf2bf38043c8f5d1 | |
parent | 5f5f7bfb6e0544544a8f7c3f36f8e00d67ff67d1 (diff) |
remove redundant menu open state variable
-rw-r--r-- | src/widget/woverview.cpp | 5 | ||||
-rw-r--r-- | src/widget/woverview.h | 1 | ||||
-rw-r--r-- | src/widget/wwaveformviewer.cpp | 14 | ||||
-rw-r--r-- | src/widget/wwaveformviewer.h | 2 |
4 files changed, 3 insertions, 19 deletions
diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 85841680d5..d84b5e2020 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -61,7 +61,6 @@ WOverview::WOverview( m_iPickupPos(0), m_iPlayPos(0), m_pHoveredMark(nullptr), - m_bHotcueMenuShowing(false), m_bTimeRulerActive(false), m_orientation(Qt::Horizontal), m_iLabelFontSize(10), @@ -539,21 +538,19 @@ void WOverview::mousePressEvent(QMouseEvent* e) { if (pHoveredCue != nullptr) { m_pCueMenuPopup->setTrackAndCue(m_pCurrentTrack, pHoveredCue); m_pCueMenuPopup->popup(e->globalPos()); - m_bHotcueMenuShowing = true; } } } } void WOverview::slotCueMenuPopupAboutToHide() { - m_bHotcueMenuShowing = false; m_pHoveredMark.clear(); update(); } void WOverview::leaveEvent(QEvent* pEvent) { Q_UNUSED(pEvent); - if (!m_bHotcueMenuShowing) { + if (!m_pCueMenuPopup->isVisible()) { m_pHoveredMark.clear(); } m_bLeftClickDragging = false; diff --git a/src/widget/woverview.h b/src/widget/woverview.h index b3b695cf58..626c65e895 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -156,7 +156,6 @@ class WOverview : public WWidget, public TrackDropTarget { int m_iPlayPos; WaveformMarkPointer m_pHoveredMark; - bool m_bHotcueMenuShowing; bool m_bTimeRulerActive; QPointF m_timeRulerPos; WaveformMarkLabel m_timeRulerPositionLabel; diff --git a/src/widget/wwaveformviewer.cpp b/src/widget/wwaveformviewer.cpp index aeae0512ba..ab98eebc36 100644 --- a/src/widget/wwaveformviewer.cpp +++ b/src/widget/wwaveformviewer.cpp @@ -23,7 +23,6 @@ WWaveformViewer::WWaveformViewer(const char* group, UserSettingsPointer pConfig, m_zoomZoneWidth(20), m_bScratching(false), m_bBending(false), - m_bHotcueMenuShowing(false), m_pCueMenuPopup(make_parented<WCueMenuPopup>(pConfig, this)), m_waveformWidget(nullptr) { setMouseTracking(true); @@ -39,10 +38,6 @@ WWaveformViewer::WWaveformViewer(const char* group, UserSettingsPointer pConfig, m_pWheel = new ControlProxy( group, "wheel", this); - connect(m_pCueMenuPopup.get(), - &WCueMenuPopup::aboutToHide, - this, - &WWaveformViewer::slotCueMenuPopupAboutToHide); setAttribute(Qt::WA_OpaquePaintEvent); } @@ -89,7 +84,6 @@ void WWaveformViewer::mousePressEvent(QMouseEvent* event) { if (cueAtClickPos) { m_pCueMenuPopup->setTrackAndCue(currentTrack, cueAtClickPos); m_pCueMenuPopup->popup(event->globalPos()); - m_bHotcueMenuShowing = true; } else { // If we are scratching then disable and reset because the two shouldn't // be used at once. @@ -102,8 +96,8 @@ void WWaveformViewer::mousePressEvent(QMouseEvent* event) { } } - // Set the cursor to a hand while the mouse is down. - if (!m_bHotcueMenuShowing) { + // Set the cursor to a hand while the mouse is down (when cue menu is not open). + if (!m_pCueMenuPopup->isVisible()) { setCursor(Qt::ClosedHandCursor); } } @@ -236,7 +230,3 @@ void WWaveformViewer::setWaveformWidget(WaveformWidgetAbstract* waveformWidget) m_waveformWidget->getWidget()->setMouseTracking(true); } } - -void WWaveformViewer::slotCueMenuPopupAboutToHide() { - m_bHotcueMenuShowing = false; -} diff --git a/src/widget/wwaveformviewer.h b/src/widget/wwaveformviewer.h index 29e1154533..8091785c69 100644 --- a/src/widget/wwaveformviewer.h +++ b/src/widget/wwaveformviewer.h @@ -52,7 +52,6 @@ private slots: void slotWidgetDead() { m_waveformWidget = nullptr; } - void slotCueMenuPopupAboutToHide(); private: void setWaveformWidget(WaveformWidgetAbstract* waveformWidget); @@ -74,7 +73,6 @@ private: ControlProxy* m_pWheel; bool m_bScratching; bool m_bBending; - bool m_bHotcueMenuShowing; QPoint m_mouseAnchor; parented_ptr<WCueMenuPopup> m_pCueMenuPopup; |