From 2d27eecd5e1299d1e2458b18f38b18e3b5c07766 Mon Sep 17 00:00:00 2001 From: Person Date: Sat, 29 Sep 2018 13:28:03 -0700 Subject: [PATCH] --Code changes -Upgrade to Qt 5.11.2 --- Source/Fractorium/DoubleSpinBox.cpp | 33 +++++++++++++++++++++++------ Source/Fractorium/SpinBox.cpp | 33 +++++++++++++++++++++++------ debian/changelog | 6 ++++++ 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/Source/Fractorium/DoubleSpinBox.cpp b/Source/Fractorium/DoubleSpinBox.cpp index b867003..027ceed 100644 --- a/Source/Fractorium/DoubleSpinBox.cpp +++ b/Source/Fractorium/DoubleSpinBox.cpp @@ -214,16 +214,37 @@ bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e) { if (e->type() == QEvent::Wheel) { - //Take special action for shift to reduce the scroll amount. Control already - //increases it automatically. if (QWheelEvent* we = dynamic_cast(e)) { - Qt::KeyboardModifiers mod = we->modifiers(); + bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier); + bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier); - if (mod.testFlag(Qt::ShiftModifier)) - setSingleStep(m_SmallStep); + if (we->angleDelta().ry() > 0) + { + if (shift) + { + setSingleStep(m_SmallStep); + setValue(value() + m_SmallStep); + } + else + { + setSingleStep(m_Step); + setValue(value() + (ctrl ? m_Step * 10 : m_Step)); + } + } else - setSingleStep(m_Step); + { + if (shift) + { + setSingleStep(m_SmallStep); + setValue(value() - m_SmallStep); + } + else + { + setSingleStep(m_Step); + setValue(value() - (ctrl ? m_Step * 10 : m_Step)); + } + } } } } diff --git a/Source/Fractorium/SpinBox.cpp b/Source/Fractorium/SpinBox.cpp index 78d22d1..838b4ae 100644 --- a/Source/Fractorium/SpinBox.cpp +++ b/Source/Fractorium/SpinBox.cpp @@ -210,16 +210,37 @@ bool SpinBox::eventFilter(QObject* o, QEvent* e) { if (e->type() == QEvent::Wheel) { - //Take special action for shift to reduce the scroll amount. Control already - //increases it automatically. if (QWheelEvent* we = dynamic_cast(e)) { - Qt::KeyboardModifiers mod = we->modifiers(); + bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier); + bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier); - if (mod.testFlag(Qt::ShiftModifier)) - setSingleStep(m_SmallStep); + if (we->angleDelta().ry() > 0) + { + if (shift) + { + setSingleStep(m_SmallStep); + setValue(value() + m_SmallStep); + } + else + { + setSingleStep(m_Step); + setValue(value() + (ctrl ? m_Step * 10 : m_Step)); + } + } else - setSingleStep(m_Step); + { + if (shift) + { + setSingleStep(m_SmallStep); + setValue(value() - m_SmallStep); + } + else + { + setSingleStep(m_Step); + setValue(value() - (ctrl ? m_Step * 10 : m_Step)); + } + } } } } diff --git a/debian/changelog b/debian/changelog index fa01e3b..1ea63ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +fractorium (1.0.0.11d-0ubuntu1) cosmic; urgency=low + + * release 1.0.0.11 + + -- Matt Feemster Sat, 29 Sep 2018 13:26:38 -0700 + fractorium (1.0.0.11c-0ubuntu1) cosmic; urgency=low * release 1.0.0.11