mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Allow ctrl-click to select dives incrementally from the globe view
I guess we should support de-selecting dives this way too, but right now the interfaces only do selection. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d3442a81b3
commit
3677f4e5ea
1 changed files with 4 additions and 1 deletions
|
@ -81,6 +81,7 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
|
||||||
|
|
||||||
int idx;
|
int idx;
|
||||||
struct dive *dive;
|
struct dive *dive;
|
||||||
|
bool clear = !(QApplication::keyboardModifiers() && Qt::ControlModifier);
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for_each_dive(idx, dive) {
|
for_each_dive(idx, dive) {
|
||||||
long lat_diff, lon_diff;
|
long lat_diff, lon_diff;
|
||||||
|
@ -95,8 +96,10 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
|
||||||
if (lat_diff > resolve || lon_diff > resolve)
|
if (lat_diff > resolve || lon_diff > resolve)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (first)
|
if (clear) {
|
||||||
mainWindow()->dive_list()->unselectDives();
|
mainWindow()->dive_list()->unselectDives();
|
||||||
|
clear = false;
|
||||||
|
}
|
||||||
mainWindow()->dive_list()->selectDive(dive, first);
|
mainWindow()->dive_list()->selectDive(dive, first);
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue