diff options
author | Be <be@mixxx.org> | 2019-10-14 23:31:47 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2019-10-14 23:31:47 -0500 |
commit | 3a3b66b389fec4fd81cd6a5710faef5ca64c0190 (patch) | |
tree | 98cebf8807e067f81912b015ae1640b083ca1332 /src | |
parent | 0b65f264a61b52ce4a50bd49ecc79c82cdf354b8 (diff) |
WOverview: add option for skins to not show cue times on mouse hover
Diffstat (limited to 'src')
-rw-r--r-- | src/widget/woverview.cpp | 18 | ||||
-rw-r--r-- | src/widget/woverview.h | 1 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index ccb558dcc8..fdf6030e65 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -55,6 +55,7 @@ WOverview::WOverview( m_pConfig(pConfig), m_endOfTrack(false), m_pCueMenu(std::make_unique<CueMenu>(this)), + m_bShowCueTimes(true), m_iPosSeconds(0), m_iPos(0), m_pHoveredMark(nullptr), @@ -182,6 +183,8 @@ void WOverview::setup(const QDomNode& node, const SkinContext& context) { m_orientation = Qt::Horizontal; } + m_bShowCueTimes = context.selectBool(node, "ShowCueTimes", true); + //qDebug() << "WOverview : m_marks" << m_marks.size(); //qDebug() << "WOverview : m_markRanges" << m_markRanges.size(); if (!m_connections.isEmpty()) { @@ -955,9 +958,12 @@ void WOverview::drawMarkLabels(QPainter* pPainter, const float offset, const flo continue; } } - if (pMark->m_label.intersects(m_cuePositionLabel) - || pMark->m_label.intersects(m_cueTimeDistanceLabel) - || pMark->m_label.intersects(m_timeRulerPositionLabel) + if (m_bShowCueTimes && + (pMark->m_label.intersects(m_cuePositionLabel) + || pMark->m_label.intersects(m_cueTimeDistanceLabel))) { + continue; + } + if (pMark->m_label.intersects(m_timeRulerPositionLabel) || pMark->m_label.intersects(m_timeRulerDistanceLabel)) { continue; } @@ -965,8 +971,10 @@ void WOverview::drawMarkLabels(QPainter* pPainter, const float offset, const flo pMark->m_label.draw(pPainter); } - m_cuePositionLabel.draw(pPainter); - m_cueTimeDistanceLabel.draw(pPainter); + if (m_bShowCueTimes) { + m_cuePositionLabel.draw(pPainter); + m_cueTimeDistanceLabel.draw(pPainter); + } // draw duration of WaveformMarkRanges for (auto&& markRange : m_markRanges) { diff --git a/src/widget/woverview.h b/src/widget/woverview.h index e8eeaf1d64..9df3e48829 100644 --- a/src/widget/woverview.h +++ b/src/widget/woverview.h @@ -145,6 +145,7 @@ class WOverview : public WWidget, public TrackDropTarget { ConstWaveformPointer m_pWaveform; std::unique_ptr<CueMenu> m_pCueMenu; + bool m_bShowCueTimes; int m_iPosSeconds; // Internal storage of slider position in pixels |