ui/test: Manual testing fixes (#949)
* Fixed tooltip list items not activated on click * Fixed crash when clearing focused graph edges after displaying graph with no edges * Updated and fixed manual graph view tests * Fixed previous location refocused when activating local symbol * Fixed crash in graph view after showing empty graph
This commit is contained in:
@@ -89,6 +89,7 @@ void CodeController::handleMessage(MessageActivateLocalSymbols* message)
|
||||
m_codeParams.activeLocalSymbolIds = message->symbolIds;
|
||||
m_codeParams.activeLocalSymbolType = LOCATION_LOCAL_SYMBOL;
|
||||
m_codeParams.currentActiveLocalLocationIds.clear();
|
||||
m_codeParams.locationIdToFocus = 0;
|
||||
showFiles(m_codeParams, CodeScrollParams(), !message->isReplayed());
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "ColorScheme.h"
|
||||
#include "MessageActivateLocalSymbols.h"
|
||||
#include "MessageActivateSourceLocations.h"
|
||||
#include "MessageActivateTokenIds.h"
|
||||
#include "MessageTabOpenWith.h"
|
||||
#include "MessageTooltipShow.h"
|
||||
#include "QtContextMenu.h"
|
||||
@@ -561,6 +562,10 @@ void QtCodeField::activateAnnotations(
|
||||
{
|
||||
MessageActivateSourceLocations(locationIds, containsUnsolved).dispatch();
|
||||
}
|
||||
else if (tokenIds.size())
|
||||
{
|
||||
MessageActivateTokenIds(utility::toVector(tokenIds)).dispatch();
|
||||
}
|
||||
else if (localSymbolIds.size())
|
||||
{
|
||||
MessageActivateLocalSymbols(utility::toVector(localSymbolIds)).dispatch();
|
||||
|
||||
@@ -32,9 +32,16 @@ void QtGraphEdge::unfocusBezierEdge()
|
||||
if (s_focusedBezierEdge)
|
||||
{
|
||||
s_focusedBezierEdge->coFocusOut();
|
||||
s_focusedBezierEdge = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphEdge::clearFocusedEdges()
|
||||
{
|
||||
s_focusedEdge = nullptr;
|
||||
s_focusedBezierEdge = nullptr;
|
||||
}
|
||||
|
||||
QtGraphEdge::QtGraphEdge(
|
||||
GraphFocusHandler* focusHandler,
|
||||
QtGraphNode* owner,
|
||||
@@ -63,9 +70,6 @@ QtGraphEdge::QtGraphEdge(
|
||||
m_owner = m_target;
|
||||
m_target = temp;
|
||||
}
|
||||
|
||||
s_focusedEdge = nullptr;
|
||||
s_focusedBezierEdge = nullptr;
|
||||
}
|
||||
|
||||
QtGraphEdge::~QtGraphEdge() {}
|
||||
|
||||
@@ -23,6 +23,7 @@ class QtGraphEdge
|
||||
|
||||
public:
|
||||
static void unfocusBezierEdge();
|
||||
static void clearFocusedEdges();
|
||||
|
||||
QtGraphEdge(
|
||||
GraphFocusHandler* focusHandler,
|
||||
|
||||
@@ -323,7 +323,7 @@ void QtGraphView::rebuildGraph(
|
||||
const GraphParams params)
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
if (m_transition && m_transition->currentTime() < m_transition->totalDuration())
|
||||
if (isTransitioning())
|
||||
{
|
||||
m_transition->stop();
|
||||
m_transition.reset();
|
||||
@@ -383,6 +383,7 @@ void QtGraphView::rebuildGraph(
|
||||
}
|
||||
|
||||
m_edges.clear();
|
||||
QtGraphEdge::clearFocusedEdges();
|
||||
|
||||
// create edges
|
||||
Graph::TrailMode trailMode = m_graph ? m_graph->getTrailMode() : Graph::TRAIL_NONE;
|
||||
@@ -558,7 +559,7 @@ void QtGraphView::scrollToValues(int xValue, int yValue)
|
||||
void QtGraphView::activateEdge(Id edgeId)
|
||||
{
|
||||
m_onQtThread([=]() {
|
||||
if (m_transition && m_transition->currentTime() < m_transition->totalDuration())
|
||||
if (isTransitioning())
|
||||
{
|
||||
m_transition->stop();
|
||||
m_transition.reset();
|
||||
@@ -629,11 +630,21 @@ void QtGraphView::focusView(bool focusIn)
|
||||
|
||||
const std::list<QtGraphNode*>& QtGraphView::getGraphNodes() const
|
||||
{
|
||||
if (isTransitioning())
|
||||
{
|
||||
return m_nodes;
|
||||
}
|
||||
|
||||
return m_oldNodes;
|
||||
}
|
||||
|
||||
const std::list<QtGraphEdge*>& QtGraphView::getGraphEdges() const
|
||||
{
|
||||
if (isTransitioning())
|
||||
{
|
||||
return m_edges;
|
||||
}
|
||||
|
||||
return m_oldEdges;
|
||||
}
|
||||
|
||||
@@ -745,7 +756,7 @@ void QtGraphView::scrolled(int)
|
||||
|
||||
void QtGraphView::resized()
|
||||
{
|
||||
if (m_transition && m_transition->currentTime() < m_transition->totalDuration())
|
||||
if (isTransitioning())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1469,3 +1480,8 @@ void QtGraphView::createTransition()
|
||||
m_transition.get(), &QPropertyAnimation::finished, this, &QtGraphView::finishedTransition);
|
||||
m_transition->start();
|
||||
}
|
||||
|
||||
bool QtGraphView::isTransitioning() const
|
||||
{
|
||||
return m_transition && m_transition->currentTime() < m_transition->totalDuration();
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ private:
|
||||
std::vector<std::pair<QtGraphNode*, QtGraphNode*>>* remainingNodes);
|
||||
|
||||
void createTransition();
|
||||
bool isTransitioning() const;
|
||||
|
||||
GraphFocusHandler m_focusHandler;
|
||||
bool m_hasFocus = false;
|
||||
|
||||
Reference in New Issue
Block a user