mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 05:22:25 -04:00
ValueDialZ: use sign wheel to reverse sign using keys
This commit is contained in:
parent
a0a8548c7b
commit
58fb967ca7
@ -474,7 +474,7 @@ void ValueDialZ::keyPressEvent(QKeyEvent* value)
|
|||||||
m_cursor--;
|
m_cursor--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_cursor < (m_positiveOnly ? 0 : 1)) {
|
if (m_cursor < 0) {
|
||||||
m_cursor++;
|
m_cursor++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,35 +504,57 @@ void ValueDialZ::keyPressEvent(QKeyEvent* value)
|
|||||||
}
|
}
|
||||||
else if(value->key() == Qt::Key_Up)
|
else if(value->key() == Qt::Key_Up)
|
||||||
{
|
{
|
||||||
qint64 e = findExponent(m_cursor);
|
if (!m_positiveOnly && (m_cursor == 0))
|
||||||
|
{
|
||||||
|
if(m_animationState != 0) {
|
||||||
|
m_value = m_valueNew;
|
||||||
|
}
|
||||||
|
|
||||||
if(value->modifiers() & Qt::ShiftModifier) {
|
m_valueNew = (-m_value < m_valueMin) ? m_valueMin : (-m_value > m_valueMax) ? m_valueMax : -m_value;
|
||||||
e *= 5;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qint64 e = findExponent(m_cursor);
|
||||||
|
|
||||||
if(m_animationState != 0) {
|
if(value->modifiers() & Qt::ShiftModifier) {
|
||||||
m_value = m_valueNew;
|
e *= 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_animationState != 0) {
|
||||||
|
m_value = m_valueNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_valueNew = m_value + e > m_valueMax ? m_valueMax : m_value + e;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_valueNew = m_value + e > m_valueMax ? m_valueMax : m_value + e;
|
|
||||||
|
|
||||||
setValue(m_valueNew);
|
setValue(m_valueNew);
|
||||||
emit changed(m_valueNew);
|
emit changed(m_valueNew);
|
||||||
}
|
}
|
||||||
else if(value->key() == Qt::Key_Down)
|
else if(value->key() == Qt::Key_Down)
|
||||||
{
|
{
|
||||||
qint64 e = findExponent(m_cursor);
|
if (!m_positiveOnly && (m_cursor == 0))
|
||||||
|
{
|
||||||
|
if(m_animationState != 0) {
|
||||||
|
m_value = m_valueNew;
|
||||||
|
}
|
||||||
|
|
||||||
if(value->modifiers() & Qt::ShiftModifier) {
|
m_valueNew = (-m_value < m_valueMin) ? m_valueMin : (-m_value > m_valueMax) ? m_valueMax : -m_value;
|
||||||
e *= 5;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qint64 e = findExponent(m_cursor);
|
||||||
|
|
||||||
if(m_animationState != 0) {
|
if(value->modifiers() & Qt::ShiftModifier) {
|
||||||
m_value = m_valueNew;
|
e *= 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_animationState != 0) {
|
||||||
|
m_value = m_valueNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_valueNew = m_value - e < m_valueMin ? m_valueMin : m_value - e;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_valueNew = m_value - e < m_valueMin ? m_valueMin : m_value - e;
|
|
||||||
|
|
||||||
setValue(m_valueNew);
|
setValue(m_valueNew);
|
||||||
emit changed(m_valueNew);
|
emit changed(m_valueNew);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user