Commit graph

13 commits

Author SHA1 Message Date
Berthold Stoeger
bece0a0652 profile: port basic dive editing to QtQuick
This needed a bit of refactoring of the ChartItem code, because
we have to be signaled on drag start. Currently only one handle
can be selected at a time. This was (implicitly) the case anyway,
as far as I can tell.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:17:15 +02:00
Berthold Stoeger
ea0085fef6 profile: convert the "ruler item" to qt-quick
Code is mostly based on the "tooltip item". The dragging code was
slightly reworked to be more logical. A "disk item" was added for
the handles.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:17:14 +02:00
Berthold Stoeger
ebf9ce6d86 profile: port picture code to qt-quick
This was very painful, because I had to implement rearranging the
paint order of the QSGNodes. The resulting code appears quite
brittle. Let's see where that brings us.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:32 +02:00
Berthold Stoeger
d0c26f42d7 profile: implement animation of the tooltip item
To do so, generalize the animation routine.

This seems to expose a QtQuick bug: we get spurious
hover-events when the tooltip item is updated in the
animation. We have to check for that to prevent
en endless loop (until the user moves the mouse out
of the profile window).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:32 +02:00
Berthold Stoeger
06b0a7eeae profile: show events in ToolTipItem
Reimplement a feature that was lost when porting the ToolTipOtem
to QtQuick. This is a bit of a longer commit, because the icon
of the event is now drawn explicitly, instead of using HTML.
This encompasses a UI change: the icon is now the icon shown
on the profile and not a general "warning" icon.

This commit also fixes update of the tooltip when panning the
profile.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:32 +02:00
Berthold Stoeger
4c227aba42 profile: activate dragging of tooltipitem
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:31 +02:00
Berthold Stoeger
13c9218ecf profile: first rudimentary port of the ToolTipItem to qt-quick
Still behaves weirdly when panning the chart.

No support for moving the ToolTipItem.

Doesn't add information on bookmarks under the mouse cursor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-12 15:15:30 +02:00
Berthold Stoeger
e3767976a3 profile: Unify desktop and mobile widgets
This breaks DPR handling, but it is a start.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
413b236867 profile: move zooming/panning code to ProfileView
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
9ab7819fd1 profile: replot profile when settings changed
It would be nice to have a single "any setting changed" signal and
not to have to listen to all of them individually...

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
196a33ba4b profile: move axis animation code to ProfileView
This feels quite a bit slower than the non-QtQuick version. This
makes sense, as there is an additional level of indirection. Instead
of painting directly, we paint into an QImage and turn that into
a QSGTexture.

Ultimately one would think that we should render directly using
QtQuick. Alas, we can't, since that would mean no more printing/
exporting of profiles. How sad.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
15ea0440ad profile: read DPR from QML page
This is needed on mobile, where some screens have a high DPR.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00
Berthold Stoeger
75886dd4d6 profile: render profile on desktop via QtQuick
This breaks all dynamic features, including animations,
zooming tooltips, planner-handles, etc. They will have to be
converted one-by-one to QtQuick, which will be a major pain,
as the ProfileView is destroyed by Qt6 on reparenting.
This means that the view cannot store any persistent state.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00