We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 009adf5 commit 97c0ce1Copy full SHA for 97c0ce1
common/tier4_state_rviz_plugin/src/custom_toggle_switch.cpp
@@ -73,10 +73,7 @@ void CustomToggleSwitch::paintEvent(QPaintEvent *)
73
void CustomToggleSwitch::mouseReleaseEvent(QMouseEvent * event)
74
{
75
if (event->button() == Qt::LeftButton) {
76
- int middleX = rect().center().x(); // Calculate the middle of the switch
77
- bool newState = event->pos().x() >= middleX; // Determine new state based on click position
78
-
79
- setCheckedState(newState);
+ setCheckedState(!isChecked());
80
}
81
QCheckBox::mouseReleaseEvent(event);
82
0 commit comments