[gnome-music/wip/mschraal/core: 161/177] searchview: Add artist activation
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/core: 161/177] searchview: Add artist activation
- Date: Wed, 3 Jul 2019 18:33:53 +0000 (UTC)
commit 7bbe6e07bd89d1e00be66f11956747426eb4d5db
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Jul 1 14:41:59 2019 +0200
searchview: Add artist activation
gnomemusic/views/searchview.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 7cb3f62b..6e4ad771 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -234,6 +234,8 @@ class SearchView(BaseView):
self.set_visible_child(self._album_widget)
def _artist_activated(self, widget, event):
+ coreartist = widget.coreartist
+
mod_mask = Gtk.accelerator_get_default_mod_mask()
if ((event.get_state() & mod_mask) == Gdk.ModifierType.CONTROL_MASK
and not self.props.selection_mode):
@@ -244,7 +246,21 @@ class SearchView(BaseView):
if (button == Gdk.BUTTON_PRIMARY
and not self.props.selection_mode):
# self.emit('song-activated', widget)
- pass
+
+ self._artist_albums_widget = ArtistAlbumsWidget(
+ coreartist, self.player, self._window, False)
+ self.add(self._artist_albums_widget)
+ self._artist_albums_widget.show()
+
+ self.bind_property(
+ 'selection-mode', self._artist_albums_widget, 'selection-mode',
+ GObject.BindingFlags.BIDIRECTIONAL)
+
+ self._headerbar.props.state = HeaderBar.State.SEARCH
+ self._headerbar.props.title = coreartist.artist
+ self._headerbar.props.subtitle = None
+ self.set_visible_child(self._artist_albums_widget)
+ self.props.search_mode_active = False
# FIXME: Need to ignore the event from the checkbox.
# if self.props.selection_mode:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]