mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-02 22:34:52 -04:00
--User changes
-Draw selection circles around all selected xforms plus the current one. --Bug fixes -Add control key as a modifier to increase the amount a spinbox is changed when using right mouse drag to edit. Previously only observed shift key to decrease the value. -Change the copy/paste selected xforms shortcuts to be Ctrl+X+C and Ctrl+X+V. --Code changes -Add function Fractorium::IsXformSelected() to determine if an xform has been selected with the checkboxes.
This commit is contained in:
@ -136,25 +136,18 @@ void DoubleSpinBox::OnTimeout()
|
||||
double scale, val;
|
||||
double d = value();
|
||||
bool shift = QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier);
|
||||
//bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
|
||||
bool ctrl = QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier);
|
||||
double amount = (m_SmallStep + m_Step) * 0.5;
|
||||
|
||||
if (shift)
|
||||
{
|
||||
//qDebug() << "Shift pressed";
|
||||
scale = 0.0001;
|
||||
}
|
||||
/* else if (ctrl)
|
||||
{
|
||||
qDebug() << "Control pressed";
|
||||
else if (ctrl)
|
||||
scale = 0.01;
|
||||
}*/
|
||||
else
|
||||
scale = 0.001;
|
||||
|
||||
val = d + (distance * amount * scale);
|
||||
setValue(val);
|
||||
//qDebug() << "Timer on, orig val: " << d << ", new val: " << val << ", distance " << distance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -174,27 +167,6 @@ bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
{
|
||||
m_MouseDownPoint = m_MouseMovePoint = me->pos();
|
||||
StartTimer();
|
||||
//qDebug() << "Right mouse down";
|
||||
// QPoint pt;
|
||||
//
|
||||
// if (QMouseEvent* me = (QMouseEvent*)e)
|
||||
// pt = me->localPos().toPoint();
|
||||
//
|
||||
// int pos = lineEdit()->cursorPositionAt(pt);
|
||||
//
|
||||
// if (lineEdit()->selectedText() != "")
|
||||
// {
|
||||
// lineEdit()->deselect();
|
||||
// lineEdit()->setCursorPosition(pos);
|
||||
// return true;
|
||||
// }
|
||||
// else if (m_Select)
|
||||
// {
|
||||
// lineEdit()->setCursorPosition(pos);
|
||||
// selectAll();
|
||||
// m_Select = false;
|
||||
// return true;
|
||||
// }
|
||||
}
|
||||
else if (isEnabled() &&
|
||||
me &&
|
||||
@ -203,7 +175,6 @@ bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
{
|
||||
StopTimer();
|
||||
m_MouseDownPoint = m_MouseMovePoint = me->pos();
|
||||
//qDebug() << "Right mouse up";
|
||||
}
|
||||
else if (isEnabled() &&
|
||||
me &&
|
||||
@ -211,7 +182,6 @@ bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
QGuiApplication::mouseButtons() & Qt::RightButton)
|
||||
{
|
||||
m_MouseMovePoint = me->pos();
|
||||
qDebug() << "Mouse move while right down. Pt = " << me->pos() << ", global: " << mapToGlobal(me->pos());
|
||||
}
|
||||
else if (m_DoubleClick && e->type() == QMouseEvent::MouseButtonDblClick && isEnabled())
|
||||
{
|
||||
@ -247,7 +217,6 @@ bool DoubleSpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
/// <param name="e">The event</param>
|
||||
void DoubleSpinBox::focusInEvent(QFocusEvent* e)
|
||||
{
|
||||
//lineEdit()->setReadOnly(false);
|
||||
StopTimer();
|
||||
QDoubleSpinBox::focusInEvent(e);
|
||||
}
|
||||
@ -261,8 +230,6 @@ void DoubleSpinBox::focusInEvent(QFocusEvent* e)
|
||||
/// <param name="e">The event</param>
|
||||
void DoubleSpinBox::focusOutEvent(QFocusEvent* e)
|
||||
{
|
||||
//lineEdit()->deselect();//Clear selection when leaving.
|
||||
//lineEdit()->setReadOnly(true);//Clever hack to clear the cursor when leaving.
|
||||
StopTimer();
|
||||
QDoubleSpinBox::focusOutEvent(e);
|
||||
}
|
||||
@ -274,8 +241,6 @@ void DoubleSpinBox::focusOutEvent(QFocusEvent* e)
|
||||
/// <param name="e">The event</param>
|
||||
void DoubleSpinBox::enterEvent(QEvent* e)
|
||||
{
|
||||
//m_Select = true;
|
||||
//setFocus();
|
||||
StopTimer();
|
||||
QDoubleSpinBox::enterEvent(e);
|
||||
}
|
||||
@ -287,8 +252,6 @@ void DoubleSpinBox::enterEvent(QEvent* e)
|
||||
/// <param name="e">The event</param>
|
||||
void DoubleSpinBox::leaveEvent(QEvent* e)
|
||||
{
|
||||
//m_Select = false;
|
||||
//clearFocus();.
|
||||
StopTimer();
|
||||
QDoubleSpinBox::leaveEvent(e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user