summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-06-04 18:32:17 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-04 10:28:08 -0700
commit9293268027e193c9da7b069706ffcb5a3ac4c68f (patch)
treeb7316fbf8a8289449b75f2a6308792e6ba49619f /profile-widget
parentefab7e33571a10a69a683839c276bdc0fd56ac12 (diff)
downloadsubsurface-9293268027e193c9da7b069706ffcb5a3ac4c68f.tar.gz
Dive picture: fix toggling of picture-visibility
In a recent commit, the profile widget was changed to reuse DivePictureItems. This made toggling of picture-visibility disfunctional, because the visibility was set in the constructor. Only on change of dive would the setting take effect. Therefore, move the setting of the visibility up to the ProfileWidget2::plotPictures() call. This is more consistent anyway, since at this level pixmap and fileUrl are set. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/divepixmapitem.cpp1
-rw-r--r--profile-widget/profilewidget2.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/profile-widget/divepixmapitem.cpp b/profile-widget/divepixmapitem.cpp
index 959e8d2c4..d295fb4dd 100644
--- a/profile-widget/divepixmapitem.cpp
+++ b/profile-widget/divepixmapitem.cpp
@@ -50,7 +50,6 @@ DivePictureItem::DivePictureItem(QGraphicsItem *parent): DivePixmapItem(parent),
#ifndef SUBSURFACE_MOBILE
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
#endif
- setVisible(prefs.show_pictures_in_profile);
canvas->setPen(Qt::NoPen);
canvas->setBrush(QColor(Qt::white));
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 5a1babb99..a69b59085 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -2077,6 +2077,7 @@ void ProfileWidget2::plotPictures()
pictures[picItemNr].reset(item);
scene()->addItem(item);
}
+ item->setVisible(prefs.show_pictures_in_profile);
item->setPixmap(m->index(i, 0).data(Qt::UserRole).value<QPixmap>());
item->setFileUrl(m->index(i, 1).data().toString());
// let's put the picture at the correct time, but at a fixed "depth" on the profile