preparing more ui pieces
This commit is contained in:
parent
bbf1d0c162
commit
be3d84be33
|
@ -1,3 +1,5 @@
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
iced::Length,
|
iced::Length,
|
||||||
iced_widget::row,
|
iced_widget::row,
|
||||||
|
@ -19,6 +21,8 @@ pub struct SongEditor {
|
||||||
fonts: combo_box::State<String>,
|
fonts: combo_box::State<String>,
|
||||||
font_sizes: Vec<String>,
|
font_sizes: Vec<String>,
|
||||||
font: String,
|
font: String,
|
||||||
|
author: String,
|
||||||
|
audio: PathBuf,
|
||||||
font_size: usize,
|
font_size: usize,
|
||||||
verse_order: String,
|
verse_order: String,
|
||||||
lyrics: text_editor::Content,
|
lyrics: text_editor::Content,
|
||||||
|
@ -36,6 +40,7 @@ pub enum Message {
|
||||||
ChangeLyrics(text_editor::Action),
|
ChangeLyrics(text_editor::Action),
|
||||||
Edit(bool),
|
Edit(bool),
|
||||||
None,
|
None,
|
||||||
|
ChangeAuthor(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SongEditor {
|
impl SongEditor {
|
||||||
|
@ -54,13 +59,15 @@ impl SongEditor {
|
||||||
Self {
|
Self {
|
||||||
song: None,
|
song: None,
|
||||||
fonts: combo_box::State::new(fonts),
|
fonts: combo_box::State::new(fonts),
|
||||||
title: String::from("Death was Arrested"),
|
title: "Death was Arrested".to_owned(),
|
||||||
font: String::from("Quicksand"),
|
font: "Quicksand".to_owned(),
|
||||||
font_size: 16,
|
font_size: 16,
|
||||||
font_sizes,
|
font_sizes,
|
||||||
verse_order: String::from("Death was Arrested"),
|
verse_order: "Death was Arrested".to_owned(),
|
||||||
lyrics: text_editor::Content::new(),
|
lyrics: text_editor::Content::new(),
|
||||||
editing: false,
|
editing: false,
|
||||||
|
author: "North Point Worship".into(),
|
||||||
|
audio: PathBuf::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn update(&mut self, message: Message) -> Task<Message> {
|
pub fn update(&mut self, message: Message) -> Task<Message> {
|
||||||
|
@ -105,6 +112,11 @@ impl SongEditor {
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
Message::None => Task::none(),
|
Message::None => Task::none(),
|
||||||
|
Message::ChangeAuthor(author) => {
|
||||||
|
debug!(author);
|
||||||
|
self.author = author;
|
||||||
|
Task::none()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +136,10 @@ impl SongEditor {
|
||||||
.on_input(Message::ChangeTitle)
|
.on_input(Message::ChangeTitle)
|
||||||
.label("Song Title");
|
.label("Song Title");
|
||||||
|
|
||||||
|
let author_input = text_input("author", &self.author)
|
||||||
|
.on_input(Message::ChangeAuthor)
|
||||||
|
.label("Song Author");
|
||||||
|
|
||||||
let verse_input = text_input(
|
let verse_input = text_input(
|
||||||
"Verse
|
"Verse
|
||||||
order",
|
order",
|
||||||
|
@ -144,6 +160,7 @@ order",
|
||||||
|
|
||||||
column::with_children(vec![
|
column::with_children(vec![
|
||||||
title_input.into(),
|
title_input.into(),
|
||||||
|
author_input.into(),
|
||||||
verse_input.into(),
|
verse_input.into(),
|
||||||
lyric_input.into(),
|
lyric_input.into(),
|
||||||
])
|
])
|
||||||
|
@ -192,3 +209,9 @@ order",
|
||||||
self.editing
|
self.editing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for SongEditor {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue