comparison view/Pane.cpp @ 255:e175ade2d6b0

* double-click in navigate mode relocates the centre frame (closing #1734854)
author Chris Cannam
date Wed, 13 Jun 2007 09:19:33 +0000
parents 28c8e8e3c537
children c492902dba40
comparison
equal deleted inserted replaced
254:a2ae3d93c645 255:e175ade2d6b0
1399 m_ctrlPressed = (e->modifiers() & Qt::ControlModifier); 1399 m_ctrlPressed = (e->modifiers() & Qt::ControlModifier);
1400 1400
1401 ViewManager::ToolMode mode = ViewManager::NavigateMode; 1401 ViewManager::ToolMode mode = ViewManager::NavigateMode;
1402 if (m_manager) mode = m_manager->getToolMode(); 1402 if (m_manager) mode = m_manager->getToolMode();
1403 1403
1404 bool relocate = (mode == ViewManager::NavigateMode ||
1405 (e->buttons() & Qt::MidButton));
1406
1404 if (mode == ViewManager::NavigateMode || 1407 if (mode == ViewManager::NavigateMode ||
1405 mode == ViewManager::EditMode) { 1408 mode == ViewManager::EditMode) {
1406 1409
1407 Layer *layer = getSelectedLayer(); 1410 Layer *layer = getSelectedLayer();
1408 if (layer && layer->isLayerEditable()) { 1411 if (layer && layer->isLayerEditable()) {
1409 layer->editOpen(this, e); 1412 if (layer->editOpen(this, e)) relocate = false;
1410 } 1413 }
1414 }
1415
1416 if (relocate) {
1417
1418 long f = getFrameForX(e->x());
1419
1420 setCentreFrame(f);
1421
1422 m_dragCentreFrame = f;
1423 m_dragStartMinValue = 0;
1424 m_dragMode = UnresolvedDrag;
1425
1426 float vmin, vmax, dmin, dmax;
1427 if (getTopLayerDisplayExtents(vmin, vmax, dmin, dmax)) {
1428 m_dragStartMinValue = dmin;
1429 }
1411 } 1430 }
1412 } 1431 }
1413 1432
1414 void 1433 void
1415 Pane::leaveEvent(QEvent *) 1434 Pane::leaveEvent(QEvent *)