# HG changeset patch # User Chris Cannam # Date 1389363470 0 # Node ID 67b167bb60abdd16d3db843197fc99d38c1e8404 # Parent 7169d08e9467e1cc32691606be218de56145fdb0 Propagate double-click in select mode -- the application might do something meaningful with this diff -r 7169d08e9467 -r 67b167bb60ab view/Pane.cpp --- a/view/Pane.cpp Fri Jan 10 14:17:10 2014 +0000 +++ b/view/Pane.cpp Fri Jan 10 14:17:50 2014 +0000 @@ -2105,6 +2105,13 @@ bool relocate = (mode == ViewManager::NavigateMode || (e->buttons() & Qt::MidButton)); + if (mode == ViewManager::SelectMode) { + m_clickedInRange = false; + m_manager->clearInProgressSelection(); + emit doubleClickSelectInvoked(getFrameForX(e->x())); + return; + } + if (mode == ViewManager::NavigateMode || mode == ViewManager::EditMode) { @@ -2453,8 +2460,8 @@ Layer *layer = getSelectedLayer(); if (offset == 0 || !layer) { - m_editingSelection = Selection(); - return true; + m_editingSelection = Selection(); + return true; } int p0 = getXForFrame(m_editingSelection.getStartFrame()) + offset; @@ -2470,21 +2477,21 @@ CommandHistory::getInstance()->startCompoundOperation (tr("Drag Selection"), true); - layer->moveSelection(m_editingSelection, f0); + layer->moveSelection(m_editingSelection, f0); } else { CommandHistory::getInstance()->startCompoundOperation (tr("Resize Selection"), true); - if (m_editingSelectionEdge < 0) { - f1 = m_editingSelection.getEndFrame(); - } else { - f0 = m_editingSelection.getStartFrame(); - } - - newSelection = Selection(f0, f1); - layer->resizeSelection(m_editingSelection, newSelection); + if (m_editingSelectionEdge < 0) { + f1 = m_editingSelection.getEndFrame(); + } else { + f0 = m_editingSelection.getStartFrame(); + } + + newSelection = Selection(f0, f1); + layer->resizeSelection(m_editingSelection, newSelection); } m_manager->removeSelection(m_editingSelection); diff -r 7169d08e9467 -r 67b167bb60ab view/Pane.h --- a/view/Pane.h Fri Jan 10 14:17:10 2014 +0000 +++ b/view/Pane.h Fri Jan 10 14:17:50 2014 +0000 @@ -67,6 +67,7 @@ void rightButtonMenuRequested(QPoint position); void dropAccepted(QStringList uriList); void dropAccepted(QString text); + void doubleClickSelectInvoked(size_t frame); public slots: virtual void toolModeChanged(); diff -r 7169d08e9467 -r 67b167bb60ab view/PaneStack.cpp --- a/view/PaneStack.cpp Fri Jan 10 14:17:10 2014 +0000 +++ b/view/PaneStack.cpp Fri Jan 10 14:17:50 2014 +0000 @@ -158,6 +158,8 @@ this, SLOT(paneDropAccepted(QStringList))); connect(pane, SIGNAL(dropAccepted(QString)), this, SLOT(paneDropAccepted(QString))); + connect(pane, SIGNAL(doubleClickSelectInvoked(size_t)), + this, SIGNAL(doubleClickSelectInvoked(size_t))); emit paneAdded(pane); emit paneAdded(); diff -r 7169d08e9467 -r 67b167bb60ab view/PaneStack.h --- a/view/PaneStack.h Fri Jan 10 14:17:10 2014 +0000 +++ b/view/PaneStack.h Fri Jan 10 14:17:50 2014 +0000 @@ -93,6 +93,8 @@ void paneDeleteButtonClicked(Pane *pane); + void doubleClickSelectInvoked(size_t frame); + public slots: void propertyContainerAdded(PropertyContainer *); void propertyContainerRemoved(PropertyContainer *);