From 8f41c6e1d0815ed5b9395a23003bdd4546c0cc53 Mon Sep 17 00:00:00 2001 From: krolxon Date: Fri, 7 Jun 2024 23:50:05 +0530 Subject: seperate UI states into App --- src/app.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 6df47ab..baea0a2 100755 --- a/src/app.rs +++ b/src/app.rs @@ -35,6 +35,11 @@ pub struct App { // Determines if the database should be updated or not pub should_update_song_list: bool, + + // States + pub queue_state: TableState, + pub browser_state: TableState, + pub playlists_state: ListState, } #[derive(Debug, PartialEq, Clone)] @@ -58,6 +63,10 @@ impl App { let browser = FileBrowser::new(); + let queue_state = TableState::new(); + let browser_state = TableState::new(); + let playlists_state = ListState::default(); + Ok(Self { running: true, conn, @@ -73,6 +82,9 @@ impl App { playlist_popup: false, append_list, should_update_song_list: false, + queue_state, + browser_state, + playlists_state, }) } -- cgit v1.2.3