[Simulator] Virtual joystick tweaks. (#4666)
* [Simulator] Create a reusable RadioTrimWidget; Move all trim-related enums to boards.h; Make sure aux trims are accounted for in SimulatorInterface; Trims now use toolbuttons with icons instead of pushbuttons with text. * [Simulator] New buttons & icons for virtual joystick axis hold/fix toggles; Joystick ball is now slightly scaled to stick area. * [Simulator] Virtual joystick now "follows" mouse clicks within the stick area (left-click on empty space will attract the control node).
This commit is contained in:
committed by
Bertrand Songis
parent
919e8eb962
commit
d68778ec81
@@ -58,7 +58,7 @@ void RadioWidget::setValue(int value)
|
||||
{
|
||||
if (value != m_value) {
|
||||
m_value = value;
|
||||
emit valueChanged(m_value);
|
||||
emit valueChanged(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void RadioWidget::addLabel()
|
||||
}
|
||||
}
|
||||
|
||||
void RadioWidget::setWidget(QWidget * widget)
|
||||
void RadioWidget::setWidget(QWidget * widget, Qt::Alignment align)
|
||||
{
|
||||
if (m_controlWidget) {
|
||||
m_gridLayout->removeWidget(m_controlWidget);
|
||||
@@ -174,7 +174,7 @@ void RadioWidget::setWidget(QWidget * widget)
|
||||
}
|
||||
m_controlWidget = widget;
|
||||
if (widget) {
|
||||
m_gridLayout->addWidget(widget, 0, 0, 1, 1, Qt::AlignHCenter);
|
||||
m_gridLayout->addWidget(widget, 0, 0, 1, 1, align);
|
||||
m_gridLayout->setRowStretch(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user