GUI
modified: src/main.rs modified: src/theme.rs modified: src/widget.rs
This commit is contained in:
parent
66722e8313
commit
cb6beb71d8
@ -80,9 +80,10 @@ fn main() -> iced::Result {
|
|||||||
println!("{}", ipod_util::get_ipod_path().is_some());
|
println!("{}", ipod_util::get_ipod_path().is_some());
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
// sidebar width 200px
|
||||||
iced::application("iLoader", App::update, App::view)
|
iced::application("iLoader", App::update, App::view)
|
||||||
.theme(App::theme)
|
.theme(App::theme)
|
||||||
|
//.transparent(true)
|
||||||
.window_size((980.0, 700.0))
|
.window_size((980.0, 700.0))
|
||||||
.run_with(App::new)
|
.run_with(App::new)
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ pub const SF_FONT: iced::Font = Font {
|
|||||||
|
|
||||||
pub fn get_default_theme() -> Theme {
|
pub fn get_default_theme() -> Theme {
|
||||||
Theme::custom("Glossy".to_string(), Palette {
|
Theme::custom("Glossy".to_string(), Palette {
|
||||||
background: Color::TRANSPARENT, // Color::from_rgb8(236, 236, 236)
|
background: Color::from_rgba8(244, 245, 245, 1.0),
|
||||||
text: Color::from_rgb8(0, 0, 0),
|
text: Color::from_rgb8(0, 0, 0),
|
||||||
primary: Color::from_rgb8(0, 122, 255),
|
primary: Color::from_rgb8(0, 122, 255),
|
||||||
success: Color::from_rgb8(52, 199, 89),
|
success: Color::from_rgb8(52, 199, 89),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use iced::{widget::{button, container, text}, Length::Fill, Padding};
|
use iced::{widget::{button, container, text}, Length::Fill, Padding, Task as Command, Element};
|
||||||
|
|
||||||
use crate::{theme, Message};
|
use crate::{theme, Message};
|
||||||
|
|
||||||
@ -11,3 +11,67 @@ pub fn basic_btn(s: &str) -> button::Button<Message> {
|
|||||||
left: 2.,
|
left: 2.,
|
||||||
})).style(theme::basic_button_theme)
|
})).style(theme::basic_button_theme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the value T should be something, that inherits ActionWindow
|
||||||
|
enum SidebarTab<T> where T: ActionWindow {
|
||||||
|
Youtube(T),
|
||||||
|
/*Spotify(T),
|
||||||
|
Soundcloud(T),
|
||||||
|
ITunes(T),
|
||||||
|
Playlists(T),
|
||||||
|
FileSystem(T),
|
||||||
|
Metadata(T),
|
||||||
|
FindCopies(T),*/
|
||||||
|
Settings(SettingsWindow)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct SidebarGroup {
|
||||||
|
tabs: Vec<SidebarTab<dyn ActionWindow>>,
|
||||||
|
name: String
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SidebarGroup {
|
||||||
|
pub fn new(name: String) -> Self {
|
||||||
|
Self{tabs: Vec::new(), name}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn name(&self) -> &String {
|
||||||
|
&self.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trait ActionWindow {
|
||||||
|
fn view(&self) -> Element<Message>;
|
||||||
|
fn update(&mut self, message: Message) -> Command<Message>;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct SettingsWindow {}
|
||||||
|
|
||||||
|
impl ActionWindow for SettingsWindow {
|
||||||
|
fn view(&self) -> Element<Message> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update(&mut self, message: Message) -> Command<Message> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct SplitView<T> where T: ActionWindow {
|
||||||
|
sidebar: Vec<SidebarGroup>,
|
||||||
|
main: Option<T>
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T: ActionWindow> SplitView<T> {
|
||||||
|
pub fn view(&self) -> Element<Message> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn update(&mut self, message: Message) -> Command<Message> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self{ sidebar: Vec::new(), main: None }
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user