summaryrefslogtreecommitdiffstats
path: root/qt-models/divepicturemodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2017-12-17 16:17:38 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-18 12:07:10 -0800
commit05a1626c7e14978c55a9670f35ff72e2a3388096 (patch)
tree191f020470db156e8e757cffc4d75980b16cabf3 /qt-models/divepicturemodel.h
parent0d01c70f3a376fbba09137ccf677cf0cd754719c (diff)
downloadsubsurface-05a1626c7e14978c55a9670f35ff72e2a3388096.tar.gz
Implement different zoom levels for dive photos tab
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divepicturemodel.h')
-rw-r--r--qt-models/divepicturemodel.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h
index 53a72076a..74f92f449 100644
--- a/qt-models/divepicturemodel.h
+++ b/qt-models/divepicturemodel.h
@@ -10,6 +10,7 @@ struct PictureEntry {
struct picture *picture;
QString filename;
QImage image;
+ QImage imageProfile; // For the profile widget keep a copy of a constant sized image
int offsetSeconds;
};
@@ -24,9 +25,13 @@ public:
void updateDivePicturesWhenDone(QList<QFuture<void>>);
void removePicture(const QString& fileUrl, bool last);
int rowDDStart, rowDDEnd;
+public slots:
+ void setZoomLevel(int level);
private:
DivePictureModel();
QList<PictureEntry> pictures;
+ double zoomLevel; // -1.0: minimum, 0.0: standard, 1.0: maximum
+ void updateThumbnails();
};
#endif