From fb3d593751d29ee6e5906914fdcc31cbd844d72b Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Fri, 15 Jan 2021 22:49:01 -0800 Subject: [PATCH] pygui: small cleanup for wireless edge creation --- daemon/core/gui/graph/edges.py | 5 ++++- daemon/core/gui/graph/manager.py | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/daemon/core/gui/graph/edges.py b/daemon/core/gui/graph/edges.py index 49bac6aa..0736b53b 100644 --- a/daemon/core/gui/graph/edges.py +++ b/daemon/core/gui/graph/edges.py @@ -172,7 +172,8 @@ class Edge: self.dst_shadow = self.src.canvas.get_shadow(self.dst) self.id = self.draw_edge(self.src.canvas, self.src, self.dst_shadow, state) self.id2 = self.draw_edge(self.dst.canvas, self.src_shadow, self.dst, state) - self.src.canvas.organize() + self.src.canvas.organize() + if self.has_shadows(): self.dst.canvas.organize() def draw_edge( @@ -472,6 +473,8 @@ class CanvasWirelessEdge(Edge): ) -> None: logging.debug("drawing wireless link from node %s to node %s", src, dst) super().__init__(app, src, dst) + self.src.wireless_edges.add(self) + self.dst.wireless_edges.add(self) self.network_id: int = network_id self.link: Link = link self.token: str = token diff --git a/daemon/core/gui/graph/manager.py b/daemon/core/gui/graph/manager.py index 4bebdb6b..f7f17e81 100644 --- a/daemon/core/gui/graph/manager.py +++ b/daemon/core/gui/graph/manager.py @@ -333,10 +333,6 @@ class CanvasManager: return edge = CanvasWirelessEdge(self.app, src, dst, network_id, token, link) self.wireless_edges[token] = edge - src.wireless_edges.add(edge) - dst.wireless_edges.add(edge) - src.canvas.tag_raise(src.id) - dst.canvas.tag_raise(dst.id) def delete_wireless_edge( self, src: CanvasNode, dst: CanvasNode, link: Link