diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-10-15 14:47:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-15 14:47:46 +0200 |
| commit | 6f0150db0092e5001c89a560c21e687eb174bac8 (patch) | |
| tree | f9f46ae5826026cf49e9c019af1f8fa97de4f403 | |
| parent | cea4f6fca893837934e3337d9e80be0495c37d82 (diff) | |
element info: add more info (#2556)
* add removed stitches info
* add color info
| -rw-r--r-- | lib/extensions/element_info.py | 7 | ||||
| -rw-r--r-- | lib/gui/element_info.py | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/extensions/element_info.py b/lib/extensions/element_info.py index a086108b..894dfe98 100644 --- a/lib/extensions/element_info.py +++ b/lib/extensions/element_info.py @@ -39,6 +39,7 @@ class ElementInfo(InkstitchExtension): self.list_items.append(ListItem( name=f"{ element.node.label } ({ element.node.get_id() })", + value=stitch_groups[0].color, headline=True )) self.list_items.append(ListItem( @@ -72,6 +73,7 @@ class ElementInfo(InkstitchExtension): )) stitch_lengths = [] + removed_stitches = 0 for group in stitch_groups: stitches = group.stitches @@ -80,6 +82,7 @@ class ElementInfo(InkstitchExtension): st = stitch - previous_stitch length = st.length() / PIXELS_PER_MM if length <= self.metadata['min_stitch_len_mm']: + removed_stitches += 1 continue stitch_lengths.append(length) previous_stitch = stitch @@ -93,6 +96,10 @@ class ElementInfo(InkstitchExtension): value=str(stitch_plan.num_stitches - stitch_plan.num_jumps) + stitches_per_group )) self.list_items.append(ListItem( + name=_("Small stitches (removed)"), + value=str(removed_stitches) + )) + self.list_items.append(ListItem( name=_("Jumps"), value=str(stitch_plan.num_jumps - 1) )) diff --git a/lib/gui/element_info.py b/lib/gui/element_info.py index dd339081..cf260b5f 100644 --- a/lib/gui/element_info.py +++ b/lib/gui/element_info.py @@ -76,6 +76,9 @@ class ElementInfoFrame(wx.Frame): if item.headline: self.info_list.SetItemBackgroundColour(self.index, "black") self.info_list.SetItemTextColour(self.index, "white") + self.index += 1 + self.info_list.InsertItem(self.index, "") + self.info_list.SetItemBackgroundColour(self.index, item.value) else: self.info_list.SetItem(self.index, 1, item.value) self.index += 1 |
