Skip to content

Commit

Permalink
Update graph colours after settings change.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyongemallo committed Nov 10, 2023
1 parent d4d6f44 commit ae77c64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zxlive/base_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def copy_selection(self) -> GraphT:
return copied_graph

def update_colors(self) -> None:
pass
self.graph_scene.update_colors()
1 change: 1 addition & 0 deletions zxlive/editor_base_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def update_side_bar(self) -> None:
populate_list_widget(self.edge_list, edges_data(), self._ety_clicked)

def update_colors(self) -> None:
super().update_colors()
self.update_side_bar()

def update_variable_viewer(self) -> None:
Expand Down
6 changes: 6 additions & 0 deletions zxlive/graphscene.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def update_graph(self, new: GraphT, select_new: bool = False) -> None:

self.select_vertices(selected_vertices)

def update_colors(self) -> None:
for v in self.vertex_map.values():
v.refresh()
for e in self.edge_map.values():
e.refresh()

def add_items(self) -> None:
"""Add QGraphicsItem's for all vertices and edges in the graph"""
self.vertex_map = {}
Expand Down

0 comments on commit ae77c64

Please sign in to comment.