# HG changeset patch # User Chris Cannam # Date 1402575258 -3600 # Node ID 7555b8b17e6e011a3ab38590069e50d654a92382 # Parent 9fd1bdf214dd5a30aca916af922f9f8d6cbab187 Move play pointer on single-click in pane in navigate mode diff -r 9fd1bdf214dd -r 7555b8b17e6e view/Pane.cpp --- a/view/Pane.cpp Thu Jun 12 12:48:11 2014 +0100 +++ b/view/Pane.cpp Thu Jun 12 13:14:18 2014 +0100 @@ -1433,6 +1433,9 @@ mouseMoveEvent(e); } + int mouseFrame = e ? getFrameForX(e->x()) : 0; + if (mouseFrame < 0) mouseFrame == 0; + if (m_navigating || mode == ViewManager::NavigateMode) { m_navigating = false; @@ -1451,6 +1454,12 @@ int y1 = std::max(m_clickPos.y(), m_mousePos.y()); emit regionOutlined(QRect(x0, y0, x1 - x0, y1 - y0)); + + } else if (m_manager && m_dragMode == UnresolvedDrag) { + + // Simple click, no drag made: move play head to the mouse + // frame location + m_manager->setPlaybackFrame(mouseFrame); } } else if (mode == ViewManager::SelectMode) { @@ -1477,16 +1486,12 @@ } else { m_manager->addSelection(selection); } - } - else if (m_manager && !m_manager->haveInProgressSelection()) { + + } else if (m_manager && !m_manager->haveInProgressSelection()) { - //cerr << "JTEST: release without selection" << endl; - // Get frame location of mouse - int mouseFrame = getFrameForX(e->x()); - //cerr << "JTEST: frame location of click is " << mouseFrame << endl; - // Move play head to that frame location - int playbackFrame = fmax(0,mouseFrame); - m_manager->setPlaybackFrame(playbackFrame); + // Simple click, no selection made: move play head to the + // mouse frame location + m_manager->setPlaybackFrame(mouseFrame); } update();