From 3d89e51418faecec40a8b0cf4d6d8f2971132cdb Mon Sep 17 00:00:00 2001 From: "alterwain@protonmail.com" Date: Sat, 14 Dec 2024 05:21:43 +0300 Subject: [PATCH] modified: src/widget.rs --- src/widget.rs | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/widget.rs b/src/widget.rs index 17bd43e..384fcfc 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -13,20 +13,20 @@ pub fn basic_btn(s: &str) -> button::Button { } // the value T should be something, that inherits ActionWindow -enum SidebarTab where T: ActionWindow { - Youtube(T), - /*Spotify(T), - Soundcloud(T), - ITunes(T), - Playlists(T), - FileSystem(T), - Metadata(T), - FindCopies(T),*/ - Settings(SettingsWindow) +enum SidebarTab { + Youtube(String), + Spotify(String), + Soundcloud(String), + ITunes(String), + Playlists(String), + FileSystem(String), + Metadata(String), + FindCopies(String), + Settings(String) } pub struct SidebarGroup { - tabs: Vec>, + tabs: Vec<(SidebarTab, Box)>, name: String } @@ -57,9 +57,21 @@ impl ActionWindow for SettingsWindow { } } +pub struct YTWindow {} + +impl ActionWindow for YTWindow { + fn view(&self) -> Element { + todo!() + } + + fn update(&mut self, message: Message) -> Command { + todo!() + } +} + pub struct SplitView where T: ActionWindow { sidebar: Vec, - main: Option + selected: Option<(SidebarTab, Box)> } impl SplitView { @@ -72,6 +84,6 @@ impl SplitView { } pub fn new() -> Self { - Self{ sidebar: Vec::new(), main: None } + Self{ sidebar: Vec::new(), selected: None } } } \ No newline at end of file