logic: correctly undoing graph interactions by replaying actions since last active token change
This change introdoces a classification of commands by order in the undo stack. Undoing the last action will resend the message of the last active token change and all messages changing the ui after that.
This commit is contained in:
@@ -175,7 +175,7 @@ void QtGraphView::doRebuildGraph(
|
||||
if (m_transition && m_transition->currentTime() < m_transition->totalDuration())
|
||||
{
|
||||
m_transition->stop();
|
||||
switchToNewGraphData();
|
||||
finishedTransition();
|
||||
}
|
||||
|
||||
QGraphicsView* view = getView();
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
#include "qt/view/graphElements/QtGraphNodeData.h"
|
||||
|
||||
QtGraphNodeExpandToggle::QtGraphNodeExpandToggle(bool expanded, int invisibleSubNodeCount)
|
||||
: m_allVisible(invisibleSubNodeCount == 0)
|
||||
: m_invisibleSubNodeCount(invisibleSubNodeCount)
|
||||
, m_expanded(expanded)
|
||||
{
|
||||
if (!expanded && !invisibleSubNodeCount)
|
||||
{
|
||||
@@ -52,7 +53,7 @@ void QtGraphNodeExpandToggle::onClick()
|
||||
|
||||
if (parent && parent->getTokenId())
|
||||
{
|
||||
MessageGraphNodeExpand(parent->getTokenId()).dispatch();
|
||||
MessageGraphNodeExpand(parent->getTokenId(), !m_expanded).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +69,6 @@ void QtGraphNodeExpandToggle::updateStyle()
|
||||
|
||||
m_icon->setPos(
|
||||
(m_rect->rect().width() - m_icon->pixmap().width() / QtDeviceScaledPixmap::devicePixelRatio()) / 2,
|
||||
(m_allVisible ? 9 : 14)
|
||||
(m_invisibleSubNodeCount == 0 ? 9 : 14)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public:
|
||||
|
||||
private:
|
||||
QGraphicsPixmapItem* m_icon;
|
||||
bool m_allVisible;
|
||||
bool m_invisibleSubNodeCount;
|
||||
bool m_expanded;
|
||||
};
|
||||
|
||||
#endif // QT_EXPAND_TOGGLE_H
|
||||
|
||||
Reference in New Issue
Block a user