mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics: support ctrl-selection for all series
Multiple selection using ctrl was only supported for scatter series. Factor out the corresponding code and use it in all series. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
64b82b16a2
commit
43b0ccca3e
6 changed files with 72 additions and 56 deletions
|
@ -411,17 +411,16 @@ void BarSeries::unhighlight()
|
|||
highlighted = Index();
|
||||
}
|
||||
|
||||
bool BarSeries::selectItemsUnderMouse(const QPointF &pos, SelectionModifier)
|
||||
bool BarSeries::selectItemsUnderMouse(const QPointF &pos, SelectionModifier modifier)
|
||||
{
|
||||
Index index = getItemUnderMouse(pos);
|
||||
if (index.bar < 0) {
|
||||
setSelection({}, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::vector<dive *> &dives = items[index.bar].subitems[index.subitem].dives;
|
||||
setSelection(dives, dives.empty() ? nullptr : dives.front());
|
||||
return true;
|
||||
std::vector<dive *> divesUnderMouse;
|
||||
if (index.bar >= 0)
|
||||
divesUnderMouse = items[index.bar].subitems[index.subitem].dives;
|
||||
processSelection(std::move(divesUnderMouse), modifier);
|
||||
|
||||
return index.bar >= 0;
|
||||
}
|
||||
|
||||
void BarSeries::divesSelected(const QVector<dive *> &)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue