Swap Zoom and Select on LTM/Ride Plot

This is a perennial issue for new users. The default
action when click dragging on a chart is to Zoom -- this
was probably right when we had no span sliders or stack
view (and no facility for marking intervals either).

But now, most users will expect click and drag on a metric
chart or ride plot to mark an interval or date range.

We get regular feature requests and bug reports related to
this -- basically the mouse actions are not intuitive.

Where selection is not meaningful (e.g. histogram) then
left click will zoom. This should be reasonably intuitive
to most users.

Fixes #398.
This commit is contained in:
Mark Liversedge
2011-09-03 11:13:45 +01:00
parent 0da64bb85e
commit f549006627
2 changed files with 6 additions and 2 deletions

View File

@@ -160,6 +160,8 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
allZoomer->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton, Qt::ShiftModifier);
allZoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
allZoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -179,7 +181,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
"");
allPlot->tooltip->setSelectionFlags(QwtPicker::PointSelection | QwtPicker::RectSelection | QwtPicker::DragSelection);
allPlot->tooltip->setRubberBand(QwtPicker::VLineRubberBand);
allPlot->tooltip->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier);
allPlot->tooltip->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
allPlot->tooltip->setTrackerPen(QColor(Qt::black));
QColor inv(Qt::white);
inv.setAlpha(0);

View File

@@ -67,6 +67,8 @@ LTMWindow::LTMWindow(MainWindow *parent, bool useMetricUnits, const QDir &home)
| QwtPicker::CornerToCorner);
ltmZoomer->setTrackerMode(QwtPicker::AlwaysOff);
ltmZoomer->setEnabled(false);
ltmZoomer->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton, Qt::ShiftModifier);
ltmZoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
ltmZoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -79,7 +81,7 @@ LTMWindow::LTMWindow(MainWindow *parent, bool useMetricUnits, const QDir &home)
ltmPlot->canvas(),
"");
picker->setMousePattern(QwtEventPattern::MouseSelect1,
Qt::LeftButton, Qt::ShiftModifier);
Qt::LeftButton);
picker->setTrackerPen(QColor(Qt::black));
QColor inv(Qt::white);
inv.setAlpha(0);