use std::{io, path::PathBuf}; use cosmic::{ dialog::file_chooser::open::Dialog, iced::{ font::{Family, Stretch, Style, Weight}, Font, Length, }, iced_wgpu::graphics::text::cosmic_text::fontdb, iced_widget::{row, stack}, theme, widget::{ button, column, combo_box, container, dropdown, horizontal_space, icon, scrollable, svg::Handle, text, text_editor, text_input, Svg, }, Element, Task, }; use dirs::font_dir; use iced_video_player::Video; use tracing::{debug, error}; use crate::{ core::{service_items::ServiceTrait, songs::Song}, Background, BackgroundKind, }; use super::presenter::slide_view; #[derive(Debug)] pub struct SongEditor { pub song: Option, title: String, font_db: fontdb::Database, fonts: Vec<(fontdb::ID, String)>, fonts_combo: combo_box::State, font_sizes: combo_box::State, font: String, author: String, audio: PathBuf, font_size: usize, verse_order: String, pub lyrics: text_editor::Content, editing: bool, background: Option, video: Option