mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profle: port event manipulation to QtQuick
UI change: the context menu is opened when left-clicking on the event. This is probably more compatible with mobile UI. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f0fe52d42b
commit
faf18ef36b
6 changed files with 147 additions and 124 deletions
|
@ -526,6 +526,8 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, int animSpeed, boo
|
|||
struct gasmix lastgasmix = d->get_gasmix_at_time(*currentdc, 1_sec);
|
||||
|
||||
for (auto [idx, event]: enumerated_range(currentdc->events)) {
|
||||
if (event.hidden)
|
||||
continue;
|
||||
// if print mode is selected only draw headings, SP change, gas events or bookmark event
|
||||
if (printMode) {
|
||||
if (event.name.empty() ||
|
||||
|
@ -663,3 +665,12 @@ std::vector<std::pair<QString, QPixmap>> ProfileScene::eventsAt(QPointF pos) con
|
|||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
DiveEventItem *ProfileScene::eventAtPosition(QPointF pos) const
|
||||
{
|
||||
for (const auto &item: eventItems) {
|
||||
if (item->contains(item->mapFromScene(pos)))
|
||||
return item.get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue