aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-05-30 16:18:54 +0530
committerkrolxon <krolyxon@tutanota.com>2024-05-30 16:18:54 +0530
commit6ae0aca8680d2ffd36442e58e5ab8b1d1b083d15 (patch)
tree69100185fb18d855359d6c2beccc12deda36ccfb
parentb31e16554ccc95b1f6996aa3573a8036132da3a4 (diff)
queue: highlight current playing song initially
-rwxr-xr-xsrc/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 0b856b4..17fd053 100755
--- a/src/main.rs
+++ b/src/main.rs
@@ -25,6 +25,11 @@ fn main() -> AppResult<()> {
// initial directory read
app.browser.update_directory(&mut app.conn)?;
+ // initially set the queue's highlighted item to the current playing item
+ if let Ok(item) = app.conn.conn.currentsong() {
+ app.queue_list.index = item.unwrap_or_default().place.unwrap_or_default().pos as usize;
+ }
+
while app.running {
tui.draw(&mut app)?;
match tui.events.next()? {