Skip to content

Commit

Permalink
Fixed list builder when used with steps
Browse files Browse the repository at this point in the history
  • Loading branch information
spirali committed May 20, 2024
1 parent 28098b9 commit 9109b3f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

* GIF support was officially removed, as it was not working in the new renderer released in 0.8

## Fixes

* Fixed problem when ListBuilder is used together with steps


# 0.8

Expand Down
4 changes: 3 additions & 1 deletion python/nelsie/helpers/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def get_box(self):

def create_item_boxes(self, box_args) -> (Box, Box):
item_box = self.main_box.box(row=True, align_items="start")
box1 = item_box.box(row=True, width=self.indent_size, justify_content="start")
show = box_args.get("show", True)
active = box_args.get("active", True)
box1 = item_box.box(row=True, width=self.indent_size, justify_content="start", show=show, active=active)
box2 = item_box.box(**box_args)
return box1, box2

Expand Down
12 changes: 12 additions & 0 deletions tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ def test_list(deck):
lst3 = lst2.list()
lst3.text("Hello!")
lst.text("Fourth item")


@check(n_slides=4)
def test_list_steps(deck):
slide = deck.new_slide(width=150, height=150)
slide.set_style("default", TextStyle(size=12))
lst = ListBox(slide)
lst.text("One")
lst.text(show="2+", text="Two1\nTwo2\nTwo3")
lst.text(show="3+", text="Long item three")
lst2 = lst.list()
lst2.text(show="4+", text="A")

0 comments on commit 9109b3f

Please sign in to comment.