diff --git a/zxlive/eitem.py b/zxlive/eitem.py index 8a89ab8..df0420b 100644 --- a/zxlive/eitem.py +++ b/zxlive/eitem.py @@ -248,7 +248,7 @@ def __init__(self, item: Union[EItem, ET], property: EItem.Properties, @property def it(self) -> EItem: if self._it is None and self.scene is not None and self.e is not None: - self._it = self.scene.edge_map[self.e] + self._it = self.scene.edge_map[self.e][0] assert self._it is not None return self._it diff --git a/zxlive/settings.py b/zxlive/settings.py index 549c995..e5ffff7 100644 --- a/zxlive/settings.py +++ b/zxlive/settings.py @@ -112,7 +112,8 @@ class ColorScheme(TypedDict): "outline": QColor("#000000"), } -classic_red_green: ColorScheme = modern_red_green | { +classic_red_green: ColorScheme = { + **modern_red_green, "id": "classic-red-green", "label": "Classic Red & Green", "z_spider": QColor("#00ff00"), @@ -121,7 +122,8 @@ class ColorScheme(TypedDict): "x_spider_pressed": QColor("#dd0b00"), } -white_gray: ColorScheme = modern_red_green | { +white_gray: ColorScheme = { + **modern_red_green, "id": 'white-grey', "label": "Dodo book White & Grey", "z_spider": QColor("#ffffff"), @@ -132,7 +134,8 @@ class ColorScheme(TypedDict): "hadamard_pressed": QColor("#dddddd"), } -gidney: ColorScheme = white_gray | { +gidney: ColorScheme = { + **white_gray, "id": 'gidney', "label": "Gidney's Black & White", "z_spider": QColor("#000000"), diff --git a/zxlive/tikz.py b/zxlive/tikz.py index 538d65d..624841c 100644 --- a/zxlive/tikz.py +++ b/zxlive/tikz.py @@ -1,7 +1,7 @@ from PySide6.QtCore import QSettings from pyzx.tikz import TIKZ_BASE, _to_tikz -from .common import get_settings_value +from .common import GraphT, get_settings_value from zxlive.proof import ProofModel @@ -23,7 +23,9 @@ def proof_to_tikz(proof: ProofModel) -> str: # Translate graph so that the first vertex starts at 0 min_x = min(g.row(v) for v in g.vertices()) - g = g.translate(-min_x, 0) + g_t = g.translate(-min_x, 0) + assert isinstance(g_t, GraphT) + g = g_t if i > 0: rewrite = proof.steps[i-1] diff --git a/zxlive/vitem.py b/zxlive/vitem.py index c261939..c9bfa07 100644 --- a/zxlive/vitem.py +++ b/zxlive/vitem.py @@ -140,12 +140,12 @@ def refresh(self) -> None: pen = QPen() if not self.isSelected(): color_key = color_map.get(self.ty, "boundary") - brush = QBrush(display_setting.colors[color_key]) + brush = QBrush(display_setting.colors[color_key]) # type: ignore # https://github.com/python/mypy/issues/7178 pen.setWidthF(3) pen.setColor(display_setting.colors["outline"]) else: color_key = pressed_color_map.get(self.ty, "boundary_pressed") - brush = QBrush(display_setting.colors[color_key]) + brush = QBrush(display_setting.colors[color_key]) # type: ignore # https://github.com/python/mypy/issues/7178 brush.setStyle(Qt.BrushStyle.Dense1Pattern) pen.setWidthF(5) if self.ty not in pressed_color_map: