aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divepicturewidget.cpp
AgeCommit message (Collapse)Author
2020-12-03cleanup: remove unnecessary includes from divepicturewidget.cppGravatar Berthold Stoeger
Also, use finer-grained Qt includes instead of the full QtWidgets include. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06media: don't send dive-id in drag&drop eventGravatar Berthold Stoeger
The profile-widget doesn't use that information anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-16Cleanup: remove unneeded QtConcurrent includesGravatar Berthold Stoeger
These became unneeded owing to code reshuffling. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-18Dive media: transport dive-id in drag'n'drop eventsGravatar Berthold Stoeger
9efb56e2d43161d952efb444d1f13d87bfdd45b5 introduced rather complex logic for picture drag'n'drop events onto the profile. Among other things, the code had to check whether the picture actually belongs to the displayed dive. This can be simplified by transporting the dive-id in the drag'n'drop event structure. The flow goes like this: DivePictureModel--(1)-->DivePictureWidget--(2)-->ProfileWidget For (1), we can use the Qt::UserRole role. This was used to transport the picture-offset, but this is not needed anymore since ProfileWidget was decoupled from DivePictureModel. For (2), we simply replace the "position" value, which was never used. Why would the receiver care which pixel was pressed in the media-tab? This commit also contains a minor cleanup in DivePictureWidget: QListView::mousePressEvent(event) was called in both branches of an if and can therefore be removed from the if. This is so trivial, that it doesn't warrant its own commit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
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>
2017-12-01Dive picture drag&drop decrease size of pixmapsGravatar Stefan Fuchs
Decrease the size of the pixmaps during drag&drop to the final unzoomed size in the profile widget. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Dive picture handling: Re enable multi select, improve mouse eventsGravatar Stefan Fuchs
Some improvements for the dive picture tab and dive pictures in profile: - Bugfix mouse event in profile: Only Left-click will open picture - Bugfix mouse events in picture tab: - Re-enable context menu (Windows bug mainly) - Re-enable multi select in a nice way - Only double-left-click will open picture Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-06Fix some warningsGravatar Dirk Hohndel
Two unused variables and one case of sign confusion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-26Don't trust event->timestamp()Gravatar Robert C. Helling
It seems the timestampt of QMouseEvents are not reliable on Linux. So we better use currentDateTime to detect a double click. Fixes #1103 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-29Make pictures respond to double clicks againGravatar Robert C. Helling
The Drag & Drop functionality swallowd the click events so double clicks never happend. So here, we detect this and call the handler explicitly. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-25Remove unused codeGravatar Dirk Hohndel
Reported-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Drag and Drop ImagesGravatar Robert C. Helling
Now that we have the possibility to add images without meaningful time stamps to a dive, we should let the user provide that time offset manually. This patch allowed pictures to be dragged from the image list to the profile. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06Move ImageDownloader out of the desktop widgetsGravatar Dirk Hohndel
This required a bit more untangling, but with this it seems we can build subsurface-mobile again (at least on the desktop). Interesting is the removal from inside the ImageDownloader of the call to DivePictureModel::instance()->updateDivePictures() - which actually could cause some interesting recursion issues. If it turns out we did indeed need this, it needs to be re-architected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Move qt-ui to desktop-widgetsGravatar Tomaz Canabrava
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>