sidebar: Give child TagRows an indented look

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2021-07-03 09:43:29 -04:00
parent 3362029123
commit d6b7a4bb8b
2 changed files with 2 additions and 0 deletions

View File

@ -90,6 +90,7 @@ class ParentTagBox(TagBox):
def on_child_tag_added(self, tag):
tag.widgets = tagrow.TagRow(tag, self.childicon)
tag.widgets.set_margin_start(35)
tag.parent.widgets.add_child(tag.widgets)
tag.TrackAdded.register(self.tag_changed)
tag.TrackRemoved.register(self.tag_changed)

View File

@ -138,6 +138,7 @@ class TestParentTagBox(unittest.TestCase):
tag1 = superstore.add(tag, "child", fake.Track(1))
ptbox.bus.complete()
self.assertIsInstance(tag1.widgets, tagrow.TagRow)
self.assertEqual(tag1.widgets.get_margin_start(), 35)
superstore.remove(tag1)
ptbox.bus.complete()