Make a map ctrl-click toggle the selection state

This way the map selection works like normal selections do.  Except we
don't do "ranged" selections (shift-click) for fairly obvious reasons.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2013-06-07 18:25:30 -07:00 committed by Dirk Hohndel
parent ef873b4082
commit 00d5ab1bdc
3 changed files with 8 additions and 4 deletions

View file

@ -82,6 +82,7 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
int idx;
struct dive *dive;
bool clear = !(QApplication::keyboardModifiers() && Qt::ControlModifier);
bool toggle = !clear;
bool first = true;
for_each_dive(idx, dive) {
long lat_diff, lon_diff;
@ -100,7 +101,7 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
mainWindow()->dive_list()->unselectDives();
clear = false;
}
mainWindow()->dive_list()->selectDive(dive, first);
mainWindow()->dive_list()->selectDive(dive, first, toggle);
first = false;
}
}