Skip to content

Commit

Permalink
fixed track play when clicked in tracks_list_widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Apr 19, 2024
1 parent 455c3a5 commit c68c019
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/widgets/tracks_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def __init__(self, _title, _window, _function):
self.more_button.set_visible(True)
self.get_function = _function

self.tracks_list_box.connect("row-activated", self.on_tracks_row_selected)

self.tracks = self.get_function(10)
for index, track in enumerate(self.tracks):
listing = GenericTrackWidget(track, self.window, False)
Expand All @@ -63,3 +65,10 @@ def on_more_clicked(self, *args):
page = fromFunctionPage(self.window, self.get_function, "track")
page.load()
self.window.navigation_view.push(page)

def on_tracks_row_selected(self, list_box, row):
index = int(row.get_name())

tracks = self.get_function(100)

self.window.player_object.play_this(tracks, index)

0 comments on commit c68c019

Please sign in to comment.