ui: Fixed graph switch animation being used for edge activation
This commit is contained in:
@@ -49,7 +49,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
m_activeEdgeIds = message->tokenIds;
|
||||
setActiveAndVisibility(utility::concat(m_activeNodeIds, m_activeEdgeIds));
|
||||
buildGraph(message, false);
|
||||
buildGraph(message, false, false);
|
||||
return;
|
||||
}
|
||||
else if (message->isAggregation)
|
||||
@@ -88,7 +88,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
|
||||
void GraphController::handleMessage(MessageFlushUpdates* message)
|
||||
{
|
||||
buildGraph(message, true);
|
||||
buildGraph(message, true, !message->keepContent());
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageSearchFullText* message)
|
||||
|
||||
@@ -173,9 +173,9 @@ void UndoRedoController::handleMessage(MessageRedo* message)
|
||||
getView()->setRedoButtonEnabled(false);
|
||||
}
|
||||
|
||||
replayCommands(oldIterator);
|
||||
bool keepsContent = replayCommands(oldIterator);
|
||||
|
||||
MessageFlushUpdates().dispatch();
|
||||
MessageFlushUpdates(keepsContent).dispatch();
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageRefresh* message)
|
||||
@@ -193,9 +193,9 @@ void UndoRedoController::handleMessage(MessageRefresh* message)
|
||||
}
|
||||
else
|
||||
{
|
||||
replayCommands();
|
||||
bool keepsContent = replayCommands();
|
||||
|
||||
MessageFlushUpdates().dispatch();
|
||||
MessageFlushUpdates(keepsContent).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,12 +289,12 @@ void UndoRedoController::handleMessage(MessageUndo* message)
|
||||
|
||||
m_iterator = it;
|
||||
|
||||
replayCommands();
|
||||
bool keepsContent = replayCommands();
|
||||
|
||||
MessageFlushUpdates().dispatch();
|
||||
MessageFlushUpdates(keepsContent).dispatch();
|
||||
}
|
||||
|
||||
void UndoRedoController::replayCommands()
|
||||
bool UndoRedoController::replayCommands()
|
||||
{
|
||||
std::list<Command>::iterator startIterator = m_iterator;
|
||||
|
||||
@@ -304,12 +304,13 @@ void UndoRedoController::replayCommands()
|
||||
}
|
||||
while (startIterator != m_list.begin() && startIterator->order != Command::ORDER_ACTIVATE);
|
||||
|
||||
replayCommands(startIterator);
|
||||
return replayCommands(startIterator);
|
||||
}
|
||||
|
||||
void UndoRedoController::replayCommands(std::list<Command>::iterator it)
|
||||
bool UndoRedoController::replayCommands(std::list<Command>::iterator it)
|
||||
{
|
||||
std::vector<std::list<Command>::iterator> viewCommands;
|
||||
bool keepsContent = true;
|
||||
|
||||
std::shared_ptr<MessageBase> m;
|
||||
while (it != m_iterator)
|
||||
@@ -321,6 +322,11 @@ void UndoRedoController::replayCommands(std::list<Command>::iterator it)
|
||||
m->setIsLast(it == std::prev(m_iterator));
|
||||
m->dispatch();
|
||||
|
||||
if (!m->keepContent())
|
||||
{
|
||||
keepsContent = false;
|
||||
}
|
||||
|
||||
if (it->order != Command::ORDER_VIEW)
|
||||
{
|
||||
viewCommands.clear();
|
||||
@@ -355,6 +361,8 @@ void UndoRedoController::replayCommands(std::list<Command>::iterator it)
|
||||
m->setIsLast(it == std::prev(m_iterator));
|
||||
m->dispatch();
|
||||
}
|
||||
|
||||
return keepsContent;
|
||||
}
|
||||
|
||||
void UndoRedoController::processCommand(Command command)
|
||||
|
||||
@@ -94,8 +94,8 @@ private:
|
||||
virtual void handleMessage(MessageShowScope* message);
|
||||
virtual void handleMessage(MessageUndo* message);
|
||||
|
||||
void replayCommands();
|
||||
void replayCommands(std::list<Command>::iterator iterator);
|
||||
bool replayCommands();
|
||||
bool replayCommands(std::list<Command>::iterator iterator);
|
||||
|
||||
void processCommand(Command command);
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@ class MessageFlushUpdates:
|
||||
public Message<MessageFlushUpdates>
|
||||
{
|
||||
public:
|
||||
MessageFlushUpdates()
|
||||
MessageFlushUpdates(bool keepsContent = false)
|
||||
{
|
||||
setKeepContent(keepsContent);
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
Reference in New Issue
Block a user