diff --git a/settings.cpp b/settings.cpp index bc1381f..a48811d 100644 --- a/settings.cpp +++ b/settings.cpp @@ -58,6 +58,9 @@ Settings::Settings(QWidget *parent) : QDialog(parent) { connect(m_ui.radioButton_zoom_alt, &QRadioButton::toggled, this, &Settings::toggleModifier4ZoomOut); + connect(m_ui.checkBox_ZoomFollowsCursor, SIGNAL(toggled(bool)), + this, SLOT(toggleZoomFollowsCursor(bool))); + // Load the settings: QSettings info; auto useDefault = info.value("usedefault", true).toBool(); @@ -79,6 +82,7 @@ Settings::Settings(QWidget *parent) : QDialog(parent) { m_ui.checkBox_DefaultLocation->setChecked(useDefault); m_ui.checkBox_VerticalDepth->setChecked(verticalDepth); m_ui.checkBox_AutoUpdate->setChecked(autoUpdate); + m_ui.checkBox_ZoomFollowsCursor->setChecked(zoomFollowsCursor); switch (modifier4DepthSlider) { case Qt::ControlModifier: m_ui.radioButton_depth_ctrl->setChecked(true); @@ -210,3 +214,9 @@ void Settings::toggleModifier4ZoomOut() { QSettings info; info.setValue("modifier4ZoomOut", modifier4ZoomOut); } + +void Settings::toggleZoomFollowsCursor(bool value) { + zoomFollowsCursor = value; + QSettings info; + info.setValue("zoomFollowsCursor", value); +} diff --git a/settings.h b/settings.h index 175a8ad..efaa74c 100644 --- a/settings.h +++ b/settings.h @@ -35,6 +35,7 @@ class Settings : public QDialog { void toggleVerticalDepth(bool on); void toggleModifier4DepthSlider(); void toggleModifier4ZoomOut(); + void toggleZoomFollowsCursor(bool on); private: Ui::Settings m_ui; diff --git a/settings.ui b/settings.ui index 47216e7..7a8a25d 100644 --- a/settings.ui +++ b/settings.ui @@ -118,82 +118,96 @@ Mouse Wheel - + - - - Depth Slider - - - - - - Shift - - - true - - - - - - - Ctrl - - - - - - - Alt - - - - - - - - - - Zoom Out - - - - - - Shift - - - - - - - Ctrl - - - true - - - - - - - Alt - - - - - + + + + + Depth Slider + + + + + + Shift + + + true + + + + + + + Ctrl + + + + + + + Alt + + + + + + + + + + Zoom Out + + + + + + Shift + + + + + + + Ctrl + + + true + + + + + + + Alt + + + + + + + + + + Without any modifier key, turning the mouse wheel controls zoom IN. + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + - + - Without any modifier key, turning the mouse wheel controls zoom IN. - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Zoom toward mouse cursor - + true