From 63f2342477168eea658fefd0ee24852b7c05f7c8 Mon Sep 17 00:00:00 2001 From: Oscar Linderholm Date: Tue, 9 Apr 2019 21:25:59 +0200 Subject: [PATCH] Set focus to search results tab --- src/ui/search.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ui/search.rs b/src/ui/search.rs index 2d4baf4..d0d77c1 100644 --- a/src/ui/search.rs +++ b/src/ui/search.rs @@ -182,6 +182,19 @@ impl SearchView { let is_track = Spotify::is_track(&query); let is_spotify_uri = is_album || is_artist || is_playlist || is_track; + // Set the active tab if the query is either one of the following + // cases. + let mut tab_idx = 0; + if is_album { + tab_idx = 1; + } else if is_artist { + tab_idx = 2; + } else if is_playlist { + tab_idx = 3; + } + let mut tab_view = self.list.get_mut(); + tab_view.move_focus_to(tab_idx); + self.edit_focused = false; {