Make buttons toggleable by single clicking

This commit is contained in:
xypwn
2020-04-04 14:07:16 +02:00
parent 5340635389
commit 7ade16be8b
20 changed files with 80 additions and 65 deletions

View File

@@ -27,7 +27,7 @@ QPainterPath ToggleButton::symbolPainterPath(QRect limits)
return QPainterPath();
}
void ToggleButton::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
void ToggleButton::partClickedEvent()
{
m_toggleState = !m_toggleState;
if(m_toggleState)
@@ -41,5 +41,4 @@ void ToggleButton::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
m_brushColorSelected = Qt::GlobalColor::red;
}
update();
Part::mouseDoubleClickEvent(event);
}