diff --git a/src/core/images.rs b/src/core/images.rs index cd9b2e7..fda63f4 100644 --- a/src/core/images.rs +++ b/src/core/images.rs @@ -10,8 +10,8 @@ use crisp::types::{Keyword, Symbol, Value}; use miette::{IntoDiagnostic, Result}; use serde::{Deserialize, Serialize}; use sqlx::{ - Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection, - query, query_as, + pool::PoolConnection, query, query_as, Sqlite, SqliteConnection, + SqlitePool, }; use std::path::{Path, PathBuf}; use tracing::{debug, error}; diff --git a/src/core/model.rs b/src/core/model.rs index 13ddda8..a778a14 100644 --- a/src/core/model.rs +++ b/src/core/model.rs @@ -1,6 +1,6 @@ use std::mem::replace; -use miette::{Result, miette}; +use miette::{miette, Result}; use sqlx::{Connection, SqliteConnection}; #[derive(Debug, Clone)] diff --git a/src/core/presentations.rs b/src/core/presentations.rs index 76d19ea..4ada88e 100644 --- a/src/core/presentations.rs +++ b/src/core/presentations.rs @@ -4,8 +4,8 @@ use miette::{IntoDiagnostic, Result}; use mupdf::{Colorspace, Document, Matrix}; use serde::{Deserialize, Serialize}; use sqlx::{ - Row, Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection, - prelude::FromRow, query, sqlite::SqliteRow, + pool::PoolConnection, prelude::FromRow, query, sqlite::SqliteRow, + Row, Sqlite, SqliteConnection, SqlitePool, }; use std::path::{Path, PathBuf}; use tracing::{debug, error}; diff --git a/src/core/service_items.rs b/src/core/service_items.rs index 5b4aed7..3912fa0 100644 --- a/src/core/service_items.rs +++ b/src/core/service_items.rs @@ -12,7 +12,7 @@ use crate::Slide; use super::images::Image; use super::presentations::Presentation; -use super::songs::{Song, lisp_to_song}; +use super::songs::{lisp_to_song, Song}; use super::videos::Video; use super::kinds::ServiceItemKind; diff --git a/src/core/slide.rs b/src/core/slide.rs index 70e60c1..30bf847 100644 --- a/src/core/slide.rs +++ b/src/core/slide.rs @@ -2,7 +2,7 @@ use cosmic::widget::image::Handle; // use cosmic::dialog::ashpd::url::Url; use crisp::types::{Keyword, Symbol, Value}; use iced_video_player::Video; -use miette::{Result, miette}; +use miette::{miette, Result}; use serde::{Deserialize, Serialize}; use std::{ fmt::Display, diff --git a/src/core/songs.rs b/src/core/songs.rs index 2be3a66..feb9d65 100644 --- a/src/core/songs.rs +++ b/src/core/songs.rs @@ -1,15 +1,15 @@ use std::{collections::HashMap, option::Option, path::PathBuf}; use crisp::types::{Keyword, Symbol, Value}; -use miette::{IntoDiagnostic, Result, miette}; +use miette::{miette, IntoDiagnostic, Result}; use serde::{Deserialize, Serialize}; use sqlx::{ - Acquire, FromRow, Row, Sqlite, SqliteConnection, SqlitePool, - pool::PoolConnection, query, sqlite::SqliteRow, + pool::PoolConnection, query, sqlite::SqliteRow, Acquire, FromRow, + Row, Sqlite, SqliteConnection, SqlitePool, }; use tracing::error; -use crate::{Slide, SlideBuilder, core::slide}; +use crate::{core::slide, Slide, SlideBuilder}; use super::{ content::Content, diff --git a/src/core/videos.rs b/src/core/videos.rs index c881572..dc97db6 100644 --- a/src/core/videos.rs +++ b/src/core/videos.rs @@ -11,8 +11,8 @@ use crisp::types::{Keyword, Symbol, Value}; use miette::{IntoDiagnostic, Result}; use serde::{Deserialize, Serialize}; use sqlx::{ - Sqlite, SqliteConnection, SqlitePool, pool::PoolConnection, - query, query_as, + pool::PoolConnection, query, query_as, Sqlite, SqliteConnection, + SqlitePool, }; use std::path::{Path, PathBuf}; use tracing::{debug, error}; diff --git a/src/lisp.rs b/src/lisp.rs index c2f4c8f..2f803e4 100644 --- a/src/lisp.rs +++ b/src/lisp.rs @@ -40,11 +40,11 @@ mod test { use std::{fs::read_to_string, path::PathBuf}; use crate::{ - Background, TextAlignment, core::{ images::Image, kinds::ServiceItemKind, service_items::ServiceTrait, songs::Song, videos::Video, }, + Background, TextAlignment, }; use super::*; diff --git a/src/main.rs b/src/main.rs index 9cd9055..472a816 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use clap::{Parser, command}; +use clap::{command, Parser}; use core::service_items::ServiceItem; use core::slide::{ Background, BackgroundKind, Slide, SlideBuilder, TextAlignment, @@ -9,8 +9,8 @@ use cosmic::iced::alignment::Vertical; use cosmic::iced::keyboard::{Key, Modifiers}; use cosmic::iced::window::{Mode, Position}; use cosmic::iced::{ - self, Background as IcedBackground, Border, Color, Length, event, - window, + self, event, window, Background as IcedBackground, Border, Color, + Length, }; use cosmic::iced_core::text::Wrapping; use cosmic::iced_futures::Subscription; @@ -21,18 +21,18 @@ use cosmic::widget::menu::key_bind::Modifier; use cosmic::widget::menu::{ItemWidth, KeyBind}; use cosmic::widget::nav_bar::nav_bar_style; use cosmic::widget::tooltip::Position as TPosition; -use cosmic::widget::{Container, menu}; use cosmic::widget::{ - Space, button, context_menu, horizontal_space, mouse_area, - nav_bar, nav_bar_toggle, responsive, scrollable, search_input, - tooltip, vertical_space, + button, context_menu, horizontal_space, mouse_area, nav_bar, + nav_bar_toggle, responsive, scrollable, search_input, tooltip, + vertical_space, Space, }; use cosmic::widget::{container, text}; use cosmic::widget::{icon, slider}; -use cosmic::{Application, ApplicationExt, Element, executor}; +use cosmic::widget::{menu, Container}; +use cosmic::{executor, Application, ApplicationExt, Element}; use crisp::types::Value; use lisp::parse_lisp; -use miette::{Result, miette}; +use miette::{miette, Result}; use rayon::prelude::*; use resvg::usvg::fontdb; use std::collections::HashMap; @@ -42,10 +42,10 @@ use std::sync::Arc; use tracing::{debug, level_filters::LevelFilter}; use tracing::{error, warn}; use tracing_subscriber::EnvFilter; -use ui::EditorMode; use ui::library::{self, Library}; use ui::presenter::{self, Presenter}; use ui::song_editor::{self, SongEditor}; +use ui::EditorMode; use crate::core::kinds::ServiceItemKind; use crate::ui::image_editor::{self, ImageEditor}; diff --git a/src/ui/image_editor.rs b/src/ui/image_editor.rs index 194484f..878fe8e 100644 --- a/src/ui/image_editor.rs +++ b/src/ui/image_editor.rs @@ -2,15 +2,15 @@ use std::{io, path::PathBuf}; use crate::core::images::Image; use cosmic::{ - Element, Task, - dialog::file_chooser::{FileFilter, open::Dialog}, - iced::{Length, alignment::Vertical}, + dialog::file_chooser::{open::Dialog, FileFilter}, + iced::{alignment::Vertical, Length}, iced_widget::{column, row}, theme, widget::{ - self, Space, button, container, horizontal_space, icon, text, - text_input, + self, button, container, horizontal_space, icon, text, + text_input, Space, }, + Element, Task, }; use tracing::{debug, error, warn}; diff --git a/src/ui/presentation_editor.rs b/src/ui/presentation_editor.rs index 17f4a9f..7b181b0 100644 --- a/src/ui/presentation_editor.rs +++ b/src/ui/presentation_editor.rs @@ -5,15 +5,15 @@ use crate::core::{ slide::Slide, }; use cosmic::{ - Element, Task, - dialog::file_chooser::{FileFilter, open::Dialog}, - iced::{Length, alignment::Vertical}, + dialog::file_chooser::{open::Dialog, FileFilter}, + iced::{alignment::Vertical, Length}, iced_widget::{column, row}, theme, widget::{ - Space, button, container, horizontal_space, icon, text, - text_input, + button, container, horizontal_space, icon, text, text_input, + Space, }, + Element, Task, }; use tracing::{debug, error, warn}; diff --git a/src/ui/presenter.rs b/src/ui/presenter.rs index 84b9e18..a758311 100644 --- a/src/ui/presenter.rs +++ b/src/ui/presenter.rs @@ -7,32 +7,32 @@ use std::{ }; use cosmic::{ - Task, iced::{ + font::{Family, Stretch, Style, Weight}, Background, Border, Color, ContentFit, Font, Length, Shadow, Vector, - font::{Family, Stretch, Style, Weight}, }, iced_widget::{ scrollable::{ - AbsoluteOffset, Direction, Scrollbar, scroll_to, + scroll_to, AbsoluteOffset, Direction, Scrollbar, }, stack, vertical_rule, }, prelude::*, widget::{ - Container, Id, Row, Space, container, image, mouse_area, - responsive, scrollable, text, + container, image, mouse_area, responsive, scrollable, text, + Container, Id, Row, Space, }, + Task, }; -use iced_video_player::{Position, Video, VideoPlayer, gst_pbutils}; +use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer}; use rodio::{Decoder, OutputStream, OutputStreamBuilder, Sink}; use tracing::{debug, error, info, warn}; use url::Url; use crate::{ - BackgroundKind, core::{service_items::ServiceItem, slide::Slide}, + BackgroundKind, }; const REFERENCE_WIDTH: f32 = 1920.0; diff --git a/src/ui/service.rs b/src/ui/service.rs index ceca63c..4a7dd81 100644 --- a/src/ui/service.rs +++ b/src/ui/service.rs @@ -2,16 +2,15 @@ use cosmic::iced::Size; use cosmic::iced_core::widget::tree; use cosmic::{ - Element, iced::{ - Event, Length, Point, Rectangle, Vector, clipboard::dnd::{DndEvent, SourceEvent}, - event, mouse, + event, mouse, Event, Length, Point, Rectangle, Vector, }, iced_core::{ - self, Clipboard, Shell, layout, renderer, widget::Tree, + self, layout, renderer, widget::Tree, Clipboard, Shell, }, widget::Widget, + Element, }; use tracing::debug; diff --git a/src/ui/slide_editor.rs b/src/ui/slide_editor.rs index ca6ce51..c9ae9cb 100644 --- a/src/ui/slide_editor.rs +++ b/src/ui/slide_editor.rs @@ -1,13 +1,13 @@ use std::{io, path::PathBuf}; use cosmic::{ - Renderer, iced::{Color, Font, Length, Size}, widget::{ self, canvas::{self, Program, Stroke}, container, }, + Renderer, }; use tracing::debug; diff --git a/src/ui/song_editor.rs b/src/ui/song_editor.rs index 309e86c..6a524bd 100644 --- a/src/ui/song_editor.rs +++ b/src/ui/song_editor.rs @@ -1,9 +1,8 @@ use std::{io, path::PathBuf, sync::Arc}; use cosmic::{ - Element, Task, - dialog::file_chooser::{FileFilter, open::Dialog}, - iced::{Length, alignment::Vertical}, + dialog::file_chooser::{open::Dialog, FileFilter}, + iced::{alignment::Vertical, Length}, iced_wgpu::graphics::text::cosmic_text::fontdb, iced_widget::{column, row}, theme, @@ -11,6 +10,7 @@ use cosmic::{ button, combo_box, container, horizontal_space, icon, progress_bar, scrollable, text, text_editor, text_input, }, + Element, Task, }; use dirs::font_dir; use iced_video_player::Video; @@ -18,11 +18,11 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use tracing::{debug, error}; use crate::{ - Background, BackgroundKind, core::{service_items::ServiceTrait, slide::Slide, songs::Song}, ui::{ presenter::slide_view, slide_editor::SlideEditor, text_svg, }, + Background, BackgroundKind, }; #[derive(Debug)] diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs index 07b0e9a..58c574a 100644 --- a/src/ui/text_svg.rs +++ b/src/ui/text_svg.rs @@ -8,16 +8,16 @@ use std::{ use colors_transform::Rgb; use cosmic::{ iced::{ - ContentFit, Length, Size, font::{Style, Weight}, + ContentFit, Length, Size, }, prelude::*, - widget::{Image, image::Handle}, + widget::{image::Handle, Image}, }; use rapidhash::v3::rapidhash_v3; use resvg::{ tiny_skia::{self, Pixmap}, - usvg::{Tree, fontdb}, + usvg::{fontdb, Tree}, }; use tracing::{debug, error}; diff --git a/src/ui/video_editor.rs b/src/ui/video_editor.rs index f4a27c1..d0d4fd2 100644 --- a/src/ui/video_editor.rs +++ b/src/ui/video_editor.rs @@ -1,15 +1,15 @@ use std::{io, path::PathBuf}; use cosmic::{ - Element, Task, - dialog::file_chooser::{FileFilter, open::Dialog}, - iced::{Length, alignment::Vertical}, + dialog::file_chooser::{open::Dialog, FileFilter}, + iced::{alignment::Vertical, Length}, iced_widget::{column, row}, theme, widget::{ - Space, button, container, horizontal_space, icon, - progress_bar, text, text_input, + button, container, horizontal_space, icon, progress_bar, + text, text_input, Space, }, + Element, Task, }; use iced_video_player::{Video, VideoPlayer}; use tracing::{debug, error, warn}; diff --git a/src/ui/widgets/draggable/column.rs b/src/ui/widgets/draggable/column.rs index 14c8af2..b35a2bc 100644 --- a/src/ui/widgets/draggable/column.rs +++ b/src/ui/widgets/draggable/column.rs @@ -22,17 +22,18 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -use cosmic::Theme; use cosmic::iced::advanced::layout::{self, Layout}; -use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree}; -use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer}; +use cosmic::iced::advanced::widget::{tree, Operation, Tree, Widget}; +use cosmic::iced::advanced::{overlay, renderer, Clipboard, Shell}; use cosmic::iced::alignment::{self, Alignment}; use cosmic::iced::event::{self, Event}; -use cosmic::iced::{self, Transformation, mouse}; +use cosmic::iced::{self, mouse, Transformation}; use cosmic::iced::{ Background, Border, Color, Element, Length, Padding, Pixels, Point, Rectangle, Size, Vector, }; +use cosmic::Theme; +use tracing::debug; use super::{Action, DragEvent, DropPosition}; diff --git a/src/ui/widgets/draggable/row.rs b/src/ui/widgets/draggable/row.rs index 67f2212..4bbaf7d 100644 --- a/src/ui/widgets/draggable/row.rs +++ b/src/ui/widgets/draggable/row.rs @@ -23,11 +23,11 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. use cosmic::iced::advanced::layout::{self, Layout}; -use cosmic::iced::advanced::widget::{Operation, Tree, Widget, tree}; -use cosmic::iced::advanced::{Clipboard, Shell, overlay, renderer}; +use cosmic::iced::advanced::widget::{tree, Operation, Tree, Widget}; +use cosmic::iced::advanced::{overlay, renderer, Clipboard, Shell}; use cosmic::iced::alignment::{self, Alignment}; use cosmic::iced::event::{self, Event}; -use cosmic::iced::{self, Transformation, mouse}; +use cosmic::iced::{self, mouse, Transformation}; use cosmic::iced::{ Background, Border, Color, Element, Length, Padding, Pixels, Point, Rectangle, Size, Theme, Vector,