mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 05:00:06 -05:00
--User changes
-Make a space bar press be the equivalent of a double click when inside of a spin box. This makes it easy to toggle without using the mouse.
This commit is contained in:
parent
47b6614c8a
commit
8c591d6163
@ -310,6 +310,13 @@ void DoubleSpinBox::keyPressEvent(QKeyEvent* ke)
|
||||
|
||||
ke->accept();
|
||||
}
|
||||
else if (ke->key() == Qt::Key_Space)
|
||||
{
|
||||
if (IsClose(m_DoubleClickLowVal, value()))
|
||||
setValue(m_DoubleClickZero);
|
||||
else
|
||||
setValue(m_DoubleClickNonZero);
|
||||
}
|
||||
else
|
||||
QDoubleSpinBox::keyPressEvent(ke);
|
||||
}
|
||||
|
@ -306,6 +306,19 @@ void SpinBox::keyPressEvent(QKeyEvent* ke)
|
||||
|
||||
ke->accept();
|
||||
}
|
||||
else if (ke->key() == Qt::Key_Space)
|
||||
{
|
||||
if (m_DoubleClickLowVal == value())
|
||||
{
|
||||
m_DoubleClickZeroEvent(this, m_DoubleClickZero);
|
||||
setValue(m_DoubleClickZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_DoubleClickNonZeroEvent(this, m_DoubleClickNonZero);
|
||||
setValue(m_DoubleClickNonZero);
|
||||
}
|
||||
}
|
||||
else
|
||||
QSpinBox::keyPressEvent(ke);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user