Mercurial > hg > svgui
comparison view/Pane.cpp @ 283:86a112b5b319
* Make it possible to "measure" a feature on the spectrogram by double-
clicking in measure mode
* Make shift-click-drag (for zoom to region) work in measure mode as well
as navigate mode. It would be nice to be able to shift-doubleclick to
zoom on a feature directly using a combination of these last two features,
but that isn't possible yet.
* Make Del delete the measurement under the mouse pointer.
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2007 15:36:37 +0000 |
parents | 4edaff85875d |
children | cd2492c5fe45 |
comparison
equal
deleted
inserted
replaced
282:4edaff85875d | 283:86a112b5b319 |
---|---|
444 m_manager->shouldShowLayerNames()) { | 444 m_manager->shouldShowLayerNames()) { |
445 drawLayerNames(r, paint); | 445 drawLayerNames(r, paint); |
446 } | 446 } |
447 | 447 |
448 if (m_shiftPressed && m_clickedInRange && | 448 if (m_shiftPressed && m_clickedInRange && |
449 toolMode == ViewManager::NavigateMode) { | 449 (toolMode == ViewManager::NavigateMode || m_navigating)) { |
450 | 450 |
451 //!!! be nice if this looked a bit more in keeping with the | 451 //!!! be nice if this looked a bit more in keeping with the |
452 //selection block | 452 //selection block |
453 | 453 |
454 paint.setPen(Qt::blue); | 454 paint.setPen(Qt::blue); |
1043 kr.setCategory(tr("Select Tool Mouse Actions")); | 1043 kr.setCategory(tr("Select Tool Mouse Actions")); |
1044 kr.registerShortcut(tr("Select"), tr("Left"), | 1044 kr.registerShortcut(tr("Select"), tr("Left"), |
1045 tr("Click left button and drag to select region; drag region edge to resize")); | 1045 tr("Click left button and drag to select region; drag region edge to resize")); |
1046 kr.registerShortcut(tr("Multi Select"), tr("Ctrl+Left"), | 1046 kr.registerShortcut(tr("Multi Select"), tr("Ctrl+Left"), |
1047 tr("Ctrl-click left button and drag to select an additional region")); | 1047 tr("Ctrl-click left button and drag to select an additional region")); |
1048 kr.registerShortcut(tr("Fine Select"), tr("Shift+Left"), | |
1049 tr("Shift-click left button and drag to select without snapping to items or grid")); | |
1048 | 1050 |
1049 kr.setCategory(tr("Edit Tool Mouse Actions")); | 1051 kr.setCategory(tr("Edit Tool Mouse Actions")); |
1050 kr.registerShortcut(tr("Move"), tr("Left"), | 1052 kr.registerShortcut(tr("Move"), tr("Left"), |
1051 tr("Click left button on an item or selected region and drag to move")); | 1053 tr("Click left button on an item or selected region and drag to move")); |
1052 kr.registerShortcut(tr("Edit"), tr("Double-Click Left"), | 1054 kr.registerShortcut(tr("Edit"), tr("Double-Click Left"), |
1059 kr.setCategory(tr("Measure Tool Mouse Actions")); | 1061 kr.setCategory(tr("Measure Tool Mouse Actions")); |
1060 kr.registerShortcut(tr("Measure Area"), tr("Left"), | 1062 kr.registerShortcut(tr("Measure Area"), tr("Left"), |
1061 tr("Click left button and drag to measure a rectangular area")); | 1063 tr("Click left button and drag to measure a rectangular area")); |
1062 kr.registerShortcut(tr("Measure Item"), tr("Double-Click Left"), | 1064 kr.registerShortcut(tr("Measure Item"), tr("Double-Click Left"), |
1063 tr("Click left button and drag to measure extents of an item or shape")); | 1065 tr("Click left button and drag to measure extents of an item or shape")); |
1066 kr.registerShortcut(tr("Zoom to Area"), tr("Shift+Left"), | |
1067 tr("Shift-click left button and drag to zoom to a rectangular area")); | |
1064 } | 1068 } |
1065 | 1069 |
1066 void | 1070 void |
1067 Pane::mousePressEvent(QMouseEvent *e) | 1071 Pane::mousePressEvent(QMouseEvent *e) |
1068 { | 1072 { |
1084 ViewManager::ToolMode mode = ViewManager::NavigateMode; | 1088 ViewManager::ToolMode mode = ViewManager::NavigateMode; |
1085 if (m_manager) mode = m_manager->getToolMode(); | 1089 if (m_manager) mode = m_manager->getToolMode(); |
1086 | 1090 |
1087 m_navigating = false; | 1091 m_navigating = false; |
1088 | 1092 |
1089 if (mode == ViewManager::NavigateMode || (e->buttons() & Qt::MidButton)) { | 1093 if (mode == ViewManager::NavigateMode || |
1094 (e->buttons() & Qt::MidButton) || | |
1095 (mode == ViewManager::MeasureMode && | |
1096 (e->buttons() & Qt::LeftButton) && m_shiftPressed)) { | |
1090 | 1097 |
1091 if (mode != ViewManager::NavigateMode) { | 1098 if (mode != ViewManager::NavigateMode) { |
1092 setCursor(Qt::PointingHandCursor); | 1099 setCursor(Qt::PointingHandCursor); |
1093 } | 1100 } |
1094 | 1101 |