diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-06-30 21:32:14 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-13 17:07:42 -0700 |
commit | 9efb56e2d43161d952efb444d1f13d87bfdd45b5 (patch) | |
tree | 6acecf55e52cea217b79d8632ab4c760ddc50070 /profile-widget/profilewidget2.h | |
parent | 0aaa1bf3862901933ed68c15a38fed9dc4c621a4 (diff) | |
download | subsurface-9efb56e2d43161d952efb444d1f13d87bfdd45b5.tar.gz |
Dive pictures: don't update all images on drag&drop to profile
Gracefully handle drag & drop to the profile, which changes the
offset of the pictures. To do this, keep the pictures in the
DivePictureModel and the ProfileWidget2 sorted by offset and
re-arrange if needed to keep the list sorted. This needs some
code reshuffling.
Introduce a helper-function that moves ranges in arrays.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r-- | profile-widget/profilewidget2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 4fdc1dc26..2640fb85a 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -236,9 +236,10 @@ private: offset_t offset; QString filename; std::unique_ptr<DivePictureItem> thumbnail; - PictureEntry (offset_t offsetIn, const QString &filenameIn); + PictureEntry (offset_t offsetIn, const QString &filenameIn, QGraphicsScene *scene); bool operator< (const PictureEntry &e) const; }; + void updateThumbnailXPos(PictureEntry &e); std::vector<PictureEntry> pictures; void calculatePictureYPositions(); |