mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
network: Fix edge selection display update.
This commit is contained in:
1 parent
a7460193b5
commit
77736b0885
1 file changed
+6
-6
@@ -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":
|
||||
|
||||
Reference in new issue
Block a user