diff view/Pane.cpp @ 716:67b167bb60ab tonioni

Propagate double-click in select mode -- the application might do something meaningful with this
author Chris Cannam
date Fri, 10 Jan 2014 14:17:50 +0000
parents 6d79ad93fef0
children 62e7d4b378ae
line wrap: on
line diff
--- 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);