comparison 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
comparison
equal deleted inserted replaced
715:7169d08e9467 716:67b167bb60ab
2103 if (m_manager) mode = m_manager->getToolModeFor(this); 2103 if (m_manager) mode = m_manager->getToolModeFor(this);
2104 2104
2105 bool relocate = (mode == ViewManager::NavigateMode || 2105 bool relocate = (mode == ViewManager::NavigateMode ||
2106 (e->buttons() & Qt::MidButton)); 2106 (e->buttons() & Qt::MidButton));
2107 2107
2108 if (mode == ViewManager::SelectMode) {
2109 m_clickedInRange = false;
2110 m_manager->clearInProgressSelection();
2111 emit doubleClickSelectInvoked(getFrameForX(e->x()));
2112 return;
2113 }
2114
2108 if (mode == ViewManager::NavigateMode || 2115 if (mode == ViewManager::NavigateMode ||
2109 mode == ViewManager::EditMode) { 2116 mode == ViewManager::EditMode) {
2110 2117
2111 Layer *layer = getSelectedLayer(); 2118 Layer *layer = getSelectedLayer();
2112 if (layer && layer->isLayerEditable()) { 2119 if (layer && layer->isLayerEditable()) {
2451 2458
2452 int offset = m_mousePos.x() - m_clickPos.x(); 2459 int offset = m_mousePos.x() - m_clickPos.x();
2453 Layer *layer = getSelectedLayer(); 2460 Layer *layer = getSelectedLayer();
2454 2461
2455 if (offset == 0 || !layer) { 2462 if (offset == 0 || !layer) {
2456 m_editingSelection = Selection(); 2463 m_editingSelection = Selection();
2457 return true; 2464 return true;
2458 } 2465 }
2459 2466
2460 int p0 = getXForFrame(m_editingSelection.getStartFrame()) + offset; 2467 int p0 = getXForFrame(m_editingSelection.getStartFrame()) + offset;
2461 int p1 = getXForFrame(m_editingSelection.getEndFrame()) + offset; 2468 int p1 = getXForFrame(m_editingSelection.getEndFrame()) + offset;
2462 2469
2468 if (m_editingSelectionEdge == 0) { 2475 if (m_editingSelectionEdge == 0) {
2469 2476
2470 CommandHistory::getInstance()->startCompoundOperation 2477 CommandHistory::getInstance()->startCompoundOperation
2471 (tr("Drag Selection"), true); 2478 (tr("Drag Selection"), true);
2472 2479
2473 layer->moveSelection(m_editingSelection, f0); 2480 layer->moveSelection(m_editingSelection, f0);
2474 2481
2475 } else { 2482 } else {
2476 2483
2477 CommandHistory::getInstance()->startCompoundOperation 2484 CommandHistory::getInstance()->startCompoundOperation
2478 (tr("Resize Selection"), true); 2485 (tr("Resize Selection"), true);
2479 2486
2480 if (m_editingSelectionEdge < 0) { 2487 if (m_editingSelectionEdge < 0) {
2481 f1 = m_editingSelection.getEndFrame(); 2488 f1 = m_editingSelection.getEndFrame();
2482 } else { 2489 } else {
2483 f0 = m_editingSelection.getStartFrame(); 2490 f0 = m_editingSelection.getStartFrame();
2484 } 2491 }
2485 2492
2486 newSelection = Selection(f0, f1); 2493 newSelection = Selection(f0, f1);
2487 layer->resizeSelection(m_editingSelection, newSelection); 2494 layer->resizeSelection(m_editingSelection, newSelection);
2488 } 2495 }
2489 2496
2490 m_manager->removeSelection(m_editingSelection); 2497 m_manager->removeSelection(m_editingSelection);
2491 m_manager->addSelection(newSelection); 2498 m_manager->addSelection(newSelection);
2492 2499