network: Fix edge selection display update.

mesh
Pierre-Antoine Rouby 2023-04-05 10:59:48 +02:00
parent a7460193b5
commit 77736b0885
1 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ class NodeItem(QGraphicsItem):
# Select color in function of node position in graph and
# status
color = Qt.blue
color = Qt.black
if self.graph.selected_new_edge_src_node() == self:
color = Qt.darkRed
elif self.graph.selected_item() == self:
@ -139,11 +139,11 @@ class EdgeItem(QGraphicsItem):
return
# Select color
color = Qt.blue
color = Qt.black
if self.graph.selected_item() == self:
color = Qt.red
elif self.graph.current_edge() == self:
color = Qt.darkBlue
color = Qt.blue
elif not self.graph.graph.is_enable_edge(self.edge):
color = Qt.darkGray
@ -537,7 +537,7 @@ class GraphWidget(QGraphicsView):
"""
return self._current_edge
def setCurrentEdge(self, edge):
def set_current_edge(self, edge):
"""Set the current edge item selected
Args:
@ -546,7 +546,7 @@ class GraphWidget(QGraphicsView):
Returns:
Nothing
"""
previous_edge = self._selected_new_edge_src_node
previous_edge = self._current_edge
self._current_edge = edge
if previous_edge:
@ -613,7 +613,7 @@ class GraphWidget(QGraphicsView):
if items and type(items[0]) == EdgeItem:
edge = items[0]
if edge:
self.setCurrentEdge(edge)
self.set_current_edge(edge)
# Add nodes and edges
elif self._state == "add":