comparison view/Pane.cpp @ 635:5c9dcec5f3e9 tonioni

splitting notes works but major cleanup needed
author gyorgyf
date Sat, 20 Apr 2013 08:38:37 +0100
parents 5b72899d692b
children c8f45afb83d5
comparison
equal deleted inserted replaced
634:4fa3951bbb05 635:5c9dcec5f3e9
1276 emit contextHelpChanged(""); 1276 emit contextHelpChanged("");
1277 emit rightButtonMenuRequested(mapToGlobal(e->pos())); 1277 emit rightButtonMenuRequested(mapToGlobal(e->pos()));
1278 return; 1278 return;
1279 } 1279 }
1280 1280
1281 // std::cerr << "mousePressEvent" << std::endl; 1281 // std::cerr << "mousePressEvent" << std::endl;
1282 1282
1283 m_clickPos = e->pos(); 1283 m_clickPos = e->pos();
1284 m_mousePos = m_clickPos; 1284 m_mousePos = m_clickPos;
1285 m_clickedInRange = true; 1285 m_clickedInRange = true;
1286 m_editingSelection = Selection(); 1286 m_editingSelection = Selection();
1376 layer->eraseStart(this, e); 1376 layer->eraseStart(this, e);
1377 } 1377 }
1378 1378
1379 } else if (mode == ViewManager::EditMode) { 1379 } else if (mode == ViewManager::EditMode) {
1380 1380
1381 std::cerr << "mouse pressed in edit mode" << std::endl;
1382 Layer *layer = getSelectedLayer();
1383 if (layer && layer->isLayerEditable()) {
1384 layer->splitStart(this, e);
1385 }
1386
1381 // Do nothing here -- we'll do it in mouseMoveEvent when the 1387 // Do nothing here -- we'll do it in mouseMoveEvent when the
1382 // drag threshold has been passed 1388 // drag threshold has been passed
1383 1389
1384 } else if (mode == ViewManager::MeasureMode) { 1390 } else if (mode == ViewManager::MeasureMode) {
1385 1391
1471 layer->eraseEnd(this, e); 1477 layer->eraseEnd(this, e);
1472 update(); 1478 update();
1473 } 1479 }
1474 1480
1475 } else if (mode == ViewManager::EditMode) { 1481 } else if (mode == ViewManager::EditMode) {
1482
1483 //GF: temporary
1484 Layer *layer = getSelectedLayer();
1485 if (layer && layer->isLayerEditable()) {
1486 layer->splitEnd(this, e);
1487 update(); }
1476 1488
1477 if (m_editing) { 1489 if (m_editing) {
1478 if (!editSelectionEnd(e)) { 1490 if (!editSelectionEnd(e)) {
1479 Layer *layer = getSelectedLayer(); 1491 Layer *layer = getSelectedLayer();
1480 if (layer && layer->isLayerEditable()) { 1492 if (layer && layer->isLayerEditable()) {
1481 layer->editEnd(this, e); 1493 layer->editEnd(this, e);
1482 update(); 1494 update();
1483 } 1495 }
1484 } 1496 }
1485 } 1497 }
1486 1498
1487 } else if (mode == ViewManager::MeasureMode) { 1499 } else if (mode == ViewManager::MeasureMode) {
1488 1500
1489 Layer *layer = getTopLayer(); 1501 Layer *layer = getTopLayer();
1490 if (layer) layer->measureEnd(this, e); 1502 if (layer) layer->measureEnd(this, e);
1613 // ... but don't set it false if shift has been 1625 // ... but don't set it false if shift has been
1614 // released -- we want the state when we started 1626 // released -- we want the state when we started
1615 // dragging to be used most of the time 1627 // dragging to be used most of the time
1616 } 1628 }
1617 1629
1618 if (m_shiftPressed) resist = false; 1630 if (m_shiftPressed) resist = false;
1619 1631
1620 m_dragMode = updateDragMode 1632 m_dragMode = updateDragMode
1621 (m_dragMode, 1633 (m_dragMode,
1622 m_clickPos, 1634 m_clickPos,
1623 e->pos(), 1635 e->pos(),