summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDivePhotos.cpp9
-rw-r--r--desktop-widgets/tab-widgets/TabDivePhotos.h1
-rw-r--r--desktop-widgets/tab-widgets/TabDivePhotos.ui36
3 files changed, 46 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.cpp b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
index 86749e770..571e0a3ac 100644
--- a/desktop-widgets/tab-widgets/TabDivePhotos.cpp
+++ b/desktop-widgets/tab-widgets/TabDivePhotos.cpp
@@ -29,6 +29,10 @@ TabDivePhotos::TabDivePhotos(QWidget *parent)
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
}
);
+ connect(ui->photosView, &DivePictureWidget::zoomLevelChanged,
+ this, &TabDivePhotos::changeZoomLevel);
+ connect(ui->zoomSlider, &QAbstractSlider::valueChanged,
+ DivePictureModel::instance(), &DivePictureModel::setZoomLevel);
}
TabDivePhotos::~TabDivePhotos()
@@ -98,3 +102,8 @@ void TabDivePhotos::updateData()
divePictureModel->updateDivePictures();
}
+void TabDivePhotos::changeZoomLevel(int delta)
+{
+ // We count on QSlider doing bound checks
+ ui->zoomSlider->setValue(ui->zoomSlider->value() + delta);
+}
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.h b/desktop-widgets/tab-widgets/TabDivePhotos.h
index 9b711595c..e2e7aa05c 100644
--- a/desktop-widgets/tab-widgets/TabDivePhotos.h
+++ b/desktop-widgets/tab-widgets/TabDivePhotos.h
@@ -26,6 +26,7 @@ private slots:
void addPhotosFromURL();
void removeAllPhotos();
void removeSelectedPhotos();
+ void changeZoomLevel(int delta);
private:
Ui::TabDivePhotos *ui;
diff --git a/desktop-widgets/tab-widgets/TabDivePhotos.ui b/desktop-widgets/tab-widgets/TabDivePhotos.ui
index 35cfd375a..21e4544e6 100644
--- a/desktop-widgets/tab-widgets/TabDivePhotos.ui
+++ b/desktop-widgets/tab-widgets/TabDivePhotos.ui
@@ -21,6 +21,42 @@
</property>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="zoomLayout">
+ <item>
+ <widget class="QLabel" name="zoomLabel">
+ <property name="text">
+ <string>Zoom level</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="zoomSlider">
+ <property name="minimum">
+ <number>-10</number>
+ </property>
+ <property name="maximum">
+ <number>10</number>
+ </property>
+ <property name="singleStep">
+ <number>1</number>
+ </property>
+ <property name="pageStep">
+ <number>1</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksBelow</enum>
+ </property>
+ <property name="tickInterval">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<customwidgets>