From 0aa518984ec6bb29c368b879c20b971f04fbc0c7 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 21 Mar 2025 13:33:07 +0100 Subject: [PATCH] chore: format for 2024 edition --- src/app/multi_window.rs | 3 +- src/app/settings.rs | 4 +- src/applet/mod.rs | 10 ++-- src/applet/token/subscription.rs | 2 +- src/applet/token/wayland_handler.rs | 2 +- src/dialog/file_chooser/open.rs | 4 +- src/dialog/file_chooser/save.rs | 4 +- src/lib.rs | 4 +- src/surface/action.rs | 29 +++++---- src/theme/style/dropdown.rs | 2 +- src/theme/style/iced.rs | 2 +- src/theme/style/segmented_button.rs | 6 +- src/widget/about.rs | 2 +- src/widget/button/link.rs | 4 +- src/widget/button/mod.rs | 14 ++--- src/widget/button/style.rs | 2 +- src/widget/button/text.rs | 2 +- src/widget/color_picker/mod.rs | 12 ++-- src/widget/context_drawer/overlay.rs | 4 +- src/widget/context_menu.rs | 4 +- src/widget/dialog.rs | 2 +- src/widget/dnd_destination.rs | 10 ++-- src/widget/dnd_source.rs | 34 +++++------ src/widget/dropdown/menu/appearance.rs | 2 +- src/widget/dropdown/menu/mod.rs | 6 +- src/widget/dropdown/multi/menu.rs | 4 +- src/widget/dropdown/multi/mod.rs | 2 +- src/widget/dropdown/multi/widget.rs | 2 +- src/widget/dropdown/widget.rs | 22 +++---- src/widget/grid/widget.rs | 4 +- src/widget/icon/handle.rs | 14 ++--- src/widget/icon/mod.rs | 2 +- src/widget/list/mod.rs | 2 +- src/widget/menu.rs | 4 +- src/widget/menu/flex.rs | 3 +- src/widget/menu/menu_bar.rs | 5 +- src/widget/menu/menu_inner.rs | 3 +- src/widget/menu/menu_tree.rs | 4 +- src/widget/mod.rs | 82 +++++++++++++------------- src/widget/nav_bar_toggle.rs | 2 +- src/widget/popover.rs | 2 +- src/widget/rectangle_tracker/mod.rs | 2 +- src/widget/responsive_container.rs | 2 +- src/widget/responsive_menu_bar.rs | 2 +- src/widget/segmented_button/mod.rs | 6 +- src/widget/segmented_button/style.rs | 2 +- src/widget/settings/item.rs | 7 +-- src/widget/settings/mod.rs | 6 +- src/widget/settings/section.rs | 2 +- src/widget/spin_button.rs | 3 +- src/widget/text_input/style.rs | 2 +- src/widget/toaster/widget.rs | 6 +- src/widget/toggler.rs | 2 +- src/widget/warning.rs | 2 +- src/widget/wayland/tooltip/mod.rs | 2 +- src/widget/wayland/tooltip/widget.rs | 18 +++--- src/widget/wrapper.rs | 4 +- 57 files changed, 196 insertions(+), 199 deletions(-) diff --git a/src/app/multi_window.rs b/src/app/multi_window.rs index 368f2f0..65ac61f 100644 --- a/src/app/multi_window.rs +++ b/src/app/multi_window.rs @@ -7,10 +7,9 @@ use iced::application; use iced::window; use iced::{ - self, + self, Program, program::{self, with_style, with_subscription, with_theme, with_title}, runtime::{Appearance, DefaultStyle}, - Program, }; use iced::{Element, Result, Settings, Subscription, Task}; diff --git a/src/app/settings.rs b/src/app/settings.rs index a5782c9..926181e 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -3,9 +3,9 @@ //! Configure a new COSMIC application. -use crate::{font, Theme}; -use iced_core::layout::Limits; +use crate::{Theme, font}; use iced_core::Font; +use iced_core::layout::Limits; /// Configure a new COSMIC application. #[allow(clippy::struct_excessive_bools)] diff --git a/src/applet/mod.rs b/src/applet/mod.rs index 25af302..a89f404 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -2,22 +2,22 @@ pub mod token; use crate::{ + Application, Element, Renderer, app::iced_settings, cctk::sctk, iced::{ - self, + self, Color, Length, Limits, Rectangle, alignment::{Horizontal, Vertical}, widget::Container, - window, Color, Length, Limits, Rectangle, + window, }, iced_widget, - theme::{self, system_dark, system_light, Button, THEME}, + theme::{self, Button, THEME, system_dark, system_light}, widget::{ self, - autosize::{self, autosize, Autosize}, + autosize::{self, Autosize, autosize}, layer_container, }, - Application, Element, Renderer, }; pub use cosmic_panel_config; use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize}; diff --git a/src/applet/token/subscription.rs b/src/applet/token/subscription.rs index e3cc619..706c030 100644 --- a/src/applet/token/subscription.rs +++ b/src/applet/token/subscription.rs @@ -2,8 +2,8 @@ use crate::iced; use crate::iced_futures::futures; use cctk::sctk::reexports::calloop; use futures::{ - channel::mpsc::{unbounded, UnboundedReceiver}, SinkExt, StreamExt, + channel::mpsc::{UnboundedReceiver, unbounded}, }; use iced::Subscription; use iced_futures::stream; diff --git a/src/applet/token/wayland_handler.rs b/src/applet/token/wayland_handler.rs index cb795c8..ee8f9b4 100644 --- a/src/applet/token/wayland_handler.rs +++ b/src/applet/token/wayland_handler.rs @@ -21,7 +21,7 @@ use sctk::{ activation::{ActivationHandler, ActivationState}, registry::{ProvidesRegistryState, RegistryState}, }; -use wayland_client::{globals::registry_queue_init, Connection, QueueHandle}; +use wayland_client::{Connection, QueueHandle, globals::registry_queue_init}; struct AppData { exit: bool, diff --git a/src/dialog/file_chooser/open.rs b/src/dialog/file_chooser/open.rs index 80e5ffb..f24afda 100644 --- a/src/dialog/file_chooser/open.rs +++ b/src/dialog/file_chooser/open.rs @@ -7,10 +7,10 @@ //! example in our repository. #[cfg(feature = "xdg-portal")] -pub use portal::{file, files, folder, folders, FileResponse, MultiFileResponse}; +pub use portal::{FileResponse, MultiFileResponse, file, files, folder, folders}; #[cfg(feature = "rfd")] -pub use rust_fd::{file, files, folder, folders, FileResponse, MultiFileResponse}; +pub use rust_fd::{FileResponse, MultiFileResponse, file, files, folder, folders}; use super::Error; use std::path::PathBuf; diff --git a/src/dialog/file_chooser/save.rs b/src/dialog/file_chooser/save.rs index 63c0734..cfb1382 100644 --- a/src/dialog/file_chooser/save.rs +++ b/src/dialog/file_chooser/save.rs @@ -7,10 +7,10 @@ //! example in our repository. #[cfg(feature = "xdg-portal")] -pub use portal::{file, Response}; +pub use portal::{Response, file}; #[cfg(feature = "rfd")] -pub use rust_fd::{file, Response}; +pub use rust_fd::{Response, file}; use super::Error; use std::path::PathBuf; diff --git a/src/lib.rs b/src/lib.rs index 0515911..119d7af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,9 +6,9 @@ /// Recommended default imports. pub mod prelude { - pub use crate::ext::*; #[cfg(feature = "winit")] pub use crate::ApplicationExt; + pub use crate::ext::*; pub use crate::{Also, Apply, Element, Renderer, Task, Theme}; } @@ -107,7 +107,7 @@ pub mod task; pub mod theme; #[doc(inline)] -pub use theme::{style, Theme}; +pub use theme::{Theme, style}; pub mod widget; type Plain = iced_core::text::paragraph::Plain<::Paragraph>; diff --git a/src/surface/action.rs b/src/surface/action.rs index af7cc2d..e27815e 100644 --- a/src/surface/action.rs +++ b/src/surface/action.rs @@ -24,9 +24,9 @@ pub fn destroy_subsurface(id: iced_core::window::Id) -> Action { #[must_use] pub fn app_popup( settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings - + Send - + Sync - + 'static, + + Send + + Sync + + 'static, view: Option< Box< dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action> @@ -58,9 +58,9 @@ pub fn app_popup( #[must_use] pub fn simple_subsurface( settings: impl Fn() -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings - + Send - + Sync - + 'static, + + Send + + Sync + + 'static, view: Option< Box crate::Element<'static, crate::Action> + Send + Sync + 'static>, >, @@ -87,9 +87,9 @@ pub fn simple_subsurface( #[must_use] pub fn simple_popup( settings: impl Fn() -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings - + Send - + Sync - + 'static, + + Send + + Sync + + 'static, view: Option< impl Fn() -> crate::Element<'static, crate::Action> + Send + Sync + 'static, >, @@ -117,10 +117,13 @@ pub fn simple_popup( #[cfg(all(feature = "wayland", feature = "winit"))] #[must_use] pub fn subsurface( - settings: impl Fn(&mut App) -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings - + Send - + Sync - + 'static, + settings: impl Fn( + &mut App, + ) + -> iced_runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings + + Send + + Sync + + 'static, // XXX Boxed trait object is required for less cumbersome type inference, but we box it anyways. view: Option< Box< diff --git a/src/theme/style/dropdown.rs b/src/theme/style/dropdown.rs index f62ab98..02c69c2 100644 --- a/src/theme/style/dropdown.rs +++ b/src/theme/style/dropdown.rs @@ -1,8 +1,8 @@ // Copyright 2023 System76 // SPDX-License-Identifier: MPL-2.0 -use crate::widget::dropdown; use crate::Theme; +use crate::widget::dropdown; use iced::{Background, Color}; impl dropdown::menu::StyleSheet for Theme { diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index 2e5d8c1..b111848 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -3,7 +3,7 @@ //! Contains stylesheet implementations for widgets native to iced. -use crate::theme::{CosmicComponent, Theme, TRANSPARENT_COMPONENT}; +use crate::theme::{CosmicComponent, TRANSPARENT_COMPONENT, Theme}; use cosmic_theme::composite::over; use iced::{ overlay::menu, diff --git a/src/theme/style/segmented_button.rs b/src/theme/style/segmented_button.rs index 8c2dbda..70e2c93 100644 --- a/src/theme/style/segmented_button.rs +++ b/src/theme/style/segmented_button.rs @@ -6,7 +6,7 @@ use crate::widget::segmented_button::{Appearance, ItemAppearance, StyleSheet}; use crate::{theme::Theme, widget::segmented_button::ItemStatusAppearance}; use cosmic_theme::{Component, Container}; -use iced_core::{border::Radius, Background}; +use iced_core::{Background, border::Radius}; #[derive(Default)] pub enum SegmentedButton { @@ -165,7 +165,7 @@ impl StyleSheet for Theme { mod horizontal { use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use cosmic_theme::Component; - use iced_core::{border::Radius, Background}; + use iced_core::{Background, border::Radius}; pub fn selection_active( cosmic: &cosmic_theme::Theme, @@ -252,7 +252,7 @@ pub fn hover( mod vertical { use crate::widget::segmented_button::{ItemAppearance, ItemStatusAppearance}; use cosmic_theme::Component; - use iced_core::{border::Radius, Background}; + use iced_core::{Background, border::Radius}; pub fn selection_active( cosmic: &cosmic_theme::Theme, diff --git a/src/widget/about.rs b/src/widget/about.rs index acd13ac..7e23da2 100644 --- a/src/widget/about.rs +++ b/src/widget/about.rs @@ -1,8 +1,8 @@ use { crate::{ + Element, iced::{Alignment, Length}, widget::{self, horizontal_space}, - Element, }, license::License, }; diff --git a/src/widget/button/link.rs b/src/widget/button/link.rs index dcfc6a3..b86ef1a 100644 --- a/src/widget/button/link.rs +++ b/src/widget/button/link.rs @@ -5,12 +5,12 @@ use super::Builder; use super::ButtonClass; +use crate::Element; use crate::prelude::*; use crate::widget::icon::{self, Handle}; use crate::widget::{button, row, tooltip}; -use crate::Element; use iced_core::text::LineHeight; -use iced_core::{font::Weight, widget::Id, Alignment, Length, Padding}; +use iced_core::{Alignment, Length, Padding, font::Weight, widget::Id}; use std::borrow::Cow; pub type Button<'a, Message> = Builder<'a, Message, Hyperlink>; diff --git a/src/widget/button/mod.rs b/src/widget/button/mod.rs index b654b27..721ee8b 100644 --- a/src/widget/button/mod.rs +++ b/src/widget/button/mod.rs @@ -8,21 +8,21 @@ pub use crate::theme::Button as ButtonClass; pub mod link; use derive_setters::Setters; #[doc(inline)] -pub use link::link; -#[doc(inline)] pub use link::Button as LinkButton; +#[doc(inline)] +pub use link::link; mod icon; #[doc(inline)] -pub use icon::icon; -#[doc(inline)] pub use icon::Button as IconButton; +#[doc(inline)] +pub use icon::icon; mod image; #[doc(inline)] -pub use image::image; -#[doc(inline)] pub use image::Button as ImageButton; +#[doc(inline)] +pub use image::image; mod style; #[doc(inline)] @@ -36,7 +36,7 @@ pub use text::{destructive, standard, suggested, text}; mod widget; #[doc(inline)] -pub use widget::{draw, focus, layout, mouse_interaction, Button}; +pub use widget::{Button, draw, focus, layout, mouse_interaction}; use iced_core::font::Weight; use iced_core::widget::Id; diff --git a/src/widget/button/style.rs b/src/widget/button/style.rs index 3610011..21afa08 100644 --- a/src/widget/button/style.rs +++ b/src/widget/button/style.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 //! Change the apperance of a button. -use iced_core::{border::Radius, Background, Color, Vector}; +use iced_core::{Background, Color, Vector, border::Radius}; use crate::theme::THEME; diff --git a/src/widget/button/text.rs b/src/widget/button/text.rs index da5f94f..e5dea9f 100644 --- a/src/widget/button/text.rs +++ b/src/widget/button/text.rs @@ -4,7 +4,7 @@ use super::{Builder, ButtonClass}; use crate::widget::{icon, row, tooltip}; use crate::{Apply, Element}; -use iced_core::{font::Weight, text::LineHeight, widget::Id, Alignment, Length, Padding}; +use iced_core::{Alignment, Length, Padding, font::Weight, text::LineHeight, widget::Id}; use std::borrow::Cow; pub type Button<'a, Message> = Builder<'a, Message, Text>; diff --git a/src/widget/color_picker/mod.rs b/src/widget/color_picker/mod.rs index 6596111..1762330 100644 --- a/src/widget/color_picker/mod.rs +++ b/src/widget/color_picker/mod.rs @@ -9,30 +9,30 @@ use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std::time::{Duration, Instant}; +use crate::Element; use crate::theme::iced::Slider; use crate::theme::{Button, THEME}; use crate::widget::{button::Catalog, container, segmented_button::Entity, slider}; -use crate::Element; use derive_setters::Setters; use iced::Task; use iced_core::event::{self, Event}; use iced_core::gradient::{ColorStop, Linear}; use iced_core::renderer::Quad; -use iced_core::widget::{tree, Tree}; +use iced_core::widget::{Tree, tree}; use iced_core::{ - layout, mouse, renderer, Background, Border, Clipboard, Color, Layout, Length, Radians, - Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, + Background, Border, Clipboard, Color, Layout, Length, Radians, Rectangle, Renderer, Shadow, + Shell, Size, Vector, Widget, layout, mouse, renderer, }; use iced_widget::slider::HandleShape; -use iced_widget::{canvas, column, horizontal_space, row, scrollable, vertical_space, Row}; +use iced_widget::{Row, canvas, column, horizontal_space, row, scrollable, vertical_space}; use lazy_static::lazy_static; use palette::{FromColor, RgbHue}; use super::divider::horizontal; use super::icon::{self, from_name}; use super::segmented_button::{self, SingleSelect}; -use super::{button, segmented_control, text, text_input, tooltip, Icon}; +use super::{Icon, button, segmented_control, text, text_input, tooltip}; #[doc(inline)] pub use ColorPickerModel as Model; diff --git a/src/widget/context_drawer/overlay.rs b/src/widget/context_drawer/overlay.rs index c4b779a..d9cc88a 100644 --- a/src/widget/context_drawer/overlay.rs +++ b/src/widget/context_drawer/overlay.rs @@ -5,9 +5,9 @@ use crate::Element; use iced::advanced::layout::{self, Layout}; use iced::advanced::widget::{self, Operation}; -use iced::advanced::{overlay, renderer}; use iced::advanced::{Clipboard, Shell}; -use iced::{event, mouse, Event, Point, Rectangle, Size}; +use iced::advanced::{overlay, renderer}; +use iced::{Event, Point, Rectangle, Size, event, mouse}; use iced_core::Renderer; pub(super) struct Overlay<'a, 'b, Message> { diff --git a/src/widget/context_menu.rs b/src/widget/context_menu.rs index 10f3ef3..8712202 100644 --- a/src/widget/context_menu.rs +++ b/src/widget/context_menu.rs @@ -9,8 +9,8 @@ use crate::widget::menu::{ use derive_setters::Setters; use iced::touch::Finger; use iced::{Event, Vector}; -use iced_core::widget::{tree, Tree, Widget}; -use iced_core::{event, mouse, touch, Length, Point, Size}; +use iced_core::widget::{Tree, Widget, tree}; +use iced_core::{Length, Point, Size, event, mouse, touch}; use std::collections::HashSet; /// A context menu is a menu in a graphical user interface that appears upon user interaction, such as a right-click mouse operation. diff --git a/src/widget/dialog.rs b/src/widget/dialog.rs index 3c8f181..34ac9bd 100644 --- a/src/widget/dialog.rs +++ b/src/widget/dialog.rs @@ -1,4 +1,4 @@ -use crate::{iced::Length, style, theme, widget, Element}; +use crate::{Element, iced::Length, style, theme, widget}; use std::borrow::Cow; pub fn dialog<'a, Message>() -> Dialog<'a, Message> { diff --git a/src/widget/dnd_destination.rs b/src/widget/dnd_destination.rs index 31fa030..89c7d44 100644 --- a/src/widget/dnd_destination.rs +++ b/src/widget/dnd_destination.rs @@ -6,22 +6,22 @@ use std::{ use iced::Vector; use crate::{ + Element, iced::{ + Event, Length, Rectangle, clipboard::{ dnd::{self, DndAction, DndDestinationRectangle, DndEvent, OfferEvent}, mime::AllowedMimeTypes, }, event, id::Internal, - mouse, overlay, Event, Length, Rectangle, + mouse, overlay, }, iced_core::{ - self, layout, - widget::{tree, Tree}, - Clipboard, Shell, + self, Clipboard, Shell, layout, + widget::{Tree, tree}, }, widget::{Id, Widget}, - Element, }; pub fn dnd_destination<'a, Message: 'static>( diff --git a/src/widget/dnd_source.rs b/src/widget/dnd_source.rs index 4936ca1..f21f967 100644 --- a/src/widget/dnd_source.rs +++ b/src/widget/dnd_source.rs @@ -3,17 +3,17 @@ use std::any::Any; use iced_core::window; use crate::{ + Element, iced::{ + Event, Length, Point, Rectangle, Vector, clipboard::dnd::{DndAction, DndEvent, SourceEvent}, - event, mouse, overlay, Event, Length, Point, Rectangle, Vector, + event, mouse, overlay, }, iced_core::{ - self, layout, renderer, - widget::{tree, Tree}, - Clipboard, Shell, + self, Clipboard, Shell, layout, renderer, + widget::{Tree, tree}, }, - widget::{container, Id, Widget}, - Element, + widget::{Id, Widget, container}, }; pub fn dnd_source< @@ -40,10 +40,10 @@ pub struct DndSource<'a, Message, D> { } impl< - 'a, - Message: Clone + 'static, - D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, - > DndSource<'a, Message, D> + 'a, + Message: Clone + 'static, + D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, +> DndSource<'a, Message, D> { pub fn new(child: impl Into>) -> Self { Self { @@ -152,10 +152,8 @@ impl< } } -impl< - Message: Clone + 'static, - D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, - > Widget for DndSource<'_, Message, D> +impl + Widget for DndSource<'_, Message, D> { fn children(&self) -> Vec { vec![Tree::new(&self.container)] @@ -400,10 +398,10 @@ impl< } impl< - 'a, - Message: Clone + 'static, - D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, - > From> for Element<'a, Message> + 'a, + Message: Clone + 'static, + D: iced::clipboard::mime::AsMimeTypes + std::marker::Send + 'static, +> From> for Element<'a, Message> { fn from(e: DndSource<'a, Message, D>) -> Element<'a, Message> { Element::new(e) diff --git a/src/widget/dropdown/menu/appearance.rs b/src/widget/dropdown/menu/appearance.rs index 64c524c..d1bed21 100644 --- a/src/widget/dropdown/menu/appearance.rs +++ b/src/widget/dropdown/menu/appearance.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MPL-2.0 AND MIT //! Change the appearance of menus. -use iced_core::{border::Radius, Background, Color}; +use iced_core::{Background, Color, border::Radius}; /// The appearance of a menu. #[derive(Debug, Clone, Copy)] diff --git a/src/widget/dropdown/menu/mod.rs b/src/widget/dropdown/menu/mod.rs index 681a4c3..0026283 100644 --- a/src/widget/dropdown/menu/mod.rs +++ b/src/widget/dropdown/menu/mod.rs @@ -9,14 +9,14 @@ use std::sync::{Arc, Mutex}; pub use appearance::{Appearance, StyleSheet}; use crate::surface; -use crate::widget::{icon, Container, RcWrapper}; +use crate::widget::{Container, RcWrapper, icon}; use iced_core::event::{self, Event}; use iced_core::layout::{self, Layout}; use iced_core::text::{self, Text}; use iced_core::widget::Tree; use iced_core::{ - alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding, - Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, + Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell, + Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch, }; use iced_widget::scrollable::Scrollable; diff --git a/src/widget/dropdown/multi/menu.rs b/src/widget/dropdown/multi/menu.rs index 3d37d92..da103f8 100644 --- a/src/widget/dropdown/multi/menu.rs +++ b/src/widget/dropdown/multi/menu.rs @@ -7,8 +7,8 @@ use iced_core::layout::{self, Layout}; use iced_core::text::{self, Text}; use iced_core::widget::Tree; use iced_core::{ - alignment, mouse, overlay, renderer, svg, touch, Border, Clipboard, Element, Length, Padding, - Pixels, Point, Rectangle, Renderer, Shadow, Shell, Size, Vector, Widget, + Border, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, Renderer, Shadow, Shell, + Size, Vector, Widget, alignment, mouse, overlay, renderer, svg, touch, }; use iced_widget::scrollable::Scrollable; diff --git a/src/widget/dropdown/multi/mod.rs b/src/widget/dropdown/multi/mod.rs index b496349..543001c 100644 --- a/src/widget/dropdown/multi/mod.rs +++ b/src/widget/dropdown/multi/mod.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MPL-2.0 AND MIT mod model; -pub use model::{list, model, List, Model}; +pub use model::{List, Model, list, model}; pub mod menu; pub use menu::Menu; diff --git a/src/widget/dropdown/multi/widget.rs b/src/widget/dropdown/multi/widget.rs index 14f89d7..1b0637b 100644 --- a/src/widget/dropdown/multi/widget.rs +++ b/src/widget/dropdown/multi/widget.rs @@ -8,10 +8,10 @@ use derive_setters::Setters; use iced_core::event::{self, Event}; use iced_core::text::{self, Paragraph, Text}; use iced_core::widget::tree::{self, Tree}; -use iced_core::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow}; use iced_core::{ Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, }; +use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch}; use iced_widget::pick_list; use std::ffi::OsStr; diff --git a/src/widget/dropdown/widget.rs b/src/widget/dropdown/widget.rs index f6cecea..826060d 100644 --- a/src/widget/dropdown/widget.rs +++ b/src/widget/dropdown/widget.rs @@ -4,16 +4,16 @@ use super::menu::{self, Menu}; use crate::widget::icon::{self, Handle}; -use crate::{surface, Element}; +use crate::{Element, surface}; use derive_setters::Setters; use iced::window; use iced_core::event::{self, Event}; use iced_core::text::{self, Paragraph, Text}; use iced_core::widget::tree::{self, Tree}; -use iced_core::{alignment, keyboard, layout, mouse, overlay, renderer, svg, touch, Shadow}; use iced_core::{ Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shell, Size, Vector, Widget, }; +use iced_core::{Shadow, alignment, keyboard, layout, mouse, overlay, renderer, svg, touch}; use iced_widget::pick_list::{self, Catalog}; use std::borrow::Cow; use std::ffi::OsStr; @@ -149,10 +149,10 @@ where } impl< - S: AsRef + Send + Sync + Clone + 'static, - Message: 'static + Clone, - AppMessage: 'static + Clone, - > Widget for Dropdown<'_, S, Message, AppMessage> + S: AsRef + Send + Sync + Clone + 'static, + Message: 'static + Clone, + AppMessage: 'static + Clone, +> Widget for Dropdown<'_, S, Message, AppMessage> where [S]: std::borrow::ToOwned, { @@ -344,11 +344,11 @@ where } impl< - 'a, - S: AsRef + Send + Sync + Clone + 'static, - Message: 'static + std::clone::Clone, - AppMessage: 'static + std::clone::Clone, - > From> for crate::Element<'a, Message> + 'a, + S: AsRef + Send + Sync + Clone + 'static, + Message: 'static + std::clone::Clone, + AppMessage: 'static + std::clone::Clone, +> From> for crate::Element<'a, Message> where [S]: std::borrow::ToOwned, { diff --git a/src/widget/grid/widget.rs b/src/widget/grid/widget.rs index 8e9efc7..0aca794 100644 --- a/src/widget/grid/widget.rs +++ b/src/widget/grid/widget.rs @@ -6,8 +6,8 @@ use derive_setters::Setters; use iced_core::event::{self, Event}; use iced_core::widget::{Operation, Tree}; use iced_core::{ - layout, mouse, overlay, renderer, Alignment, Clipboard, Layout, Length, Padding, Rectangle, - Shell, Vector, Widget, + Alignment, Clipboard, Layout, Length, Padding, Rectangle, Shell, Vector, Widget, layout, mouse, + overlay, renderer, }; /// Responsively generates rows and columns of widgets based on its dimmensions. diff --git a/src/widget/icon/handle.rs b/src/widget/icon/handle.rs index 2d30427..1fa2d85 100644 --- a/src/widget/icon/handle.rs +++ b/src/widget/icon/handle.rs @@ -49,10 +49,10 @@ pub fn from_path(path: PathBuf) -> Handle { /// Create an image handle from memory. pub fn from_raster_bytes( bytes: impl Into> - + std::convert::AsRef<[u8]> - + std::marker::Send - + std::marker::Sync - + 'static, + + std::convert::AsRef<[u8]> + + std::marker::Send + + std::marker::Sync + + 'static, ) -> Handle { fn inner(bytes: Cow<'static, [u8]>) -> Handle { Handle { @@ -72,9 +72,9 @@ pub fn from_raster_pixels( width: u32, height: u32, pixels: impl Into> - + std::convert::AsRef<[u8]> - + std::marker::Send - + std::marker::Sync, + + std::convert::AsRef<[u8]> + + std::marker::Send + + std::marker::Sync, ) -> Handle { fn inner(width: u32, height: u32, pixels: Cow<'static, [u8]>) -> Handle { Handle { diff --git a/src/widget/icon/mod.rs b/src/widget/icon/mod.rs index 45d5451..5a90d35 100644 --- a/src/widget/icon/mod.rs +++ b/src/widget/icon/mod.rs @@ -10,7 +10,7 @@ use std::sync::Arc; pub use named::{IconFallback, Named}; mod handle; -pub use handle::{from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes, Data, Handle}; +pub use handle::{Data, Handle, from_path, from_raster_bytes, from_raster_pixels, from_svg_bytes}; use crate::Element; use derive_setters::Setters; diff --git a/src/widget/list/mod.rs b/src/widget/list/mod.rs index 7ec5d10..c6e2051 100644 --- a/src/widget/list/mod.rs +++ b/src/widget/list/mod.rs @@ -3,4 +3,4 @@ pub mod column; -pub use self::column::{list_column, ListColumn}; +pub use self::column::{ListColumn, list_column}; diff --git a/src/widget/menu.rs b/src/widget/menu.rs index f5c9c46..2b54bf6 100644 --- a/src/widget/menu.rs +++ b/src/widget/menu.rs @@ -64,12 +64,12 @@ pub use key_bind::KeyBind; mod menu_bar; pub(crate) use menu_bar::MenuBarState; -pub use menu_bar::{menu_bar as bar, MenuBar}; +pub use menu_bar::{MenuBar, menu_bar as bar}; mod menu_inner; mod menu_tree; pub use menu_tree::{ - menu_button, menu_items as items, menu_root as root, MenuItem as Item, MenuTree as Tree, + MenuItem as Item, MenuTree as Tree, menu_button, menu_items as items, menu_root as root, }; pub use crate::style::menu_bar::{Appearance, StyleSheet}; diff --git a/src/widget/menu/flex.rs b/src/widget/menu/flex.rs index e793057..c093e80 100644 --- a/src/widget/menu/flex.rs +++ b/src/widget/menu/flex.rs @@ -2,8 +2,9 @@ use iced_core::widget::Tree; use iced_widget::core::{ + Alignment, Element, Padding, Point, Size, layout::{Limits, Node}, - renderer, Alignment, Element, Padding, Point, Size, + renderer, }; /// The main axis of a flex layout. diff --git a/src/widget/menu/menu_bar.rs b/src/widget/menu/menu_bar.rs index 283e592..2584e76 100644 --- a/src/widget/menu/menu_bar.rs +++ b/src/widget/menu/menu_bar.rs @@ -12,12 +12,11 @@ use crate::style::menu_bar::StyleSheet; use iced::{Point, Vector}; use iced_core::Border; use iced_widget::core::{ - event, + Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, event, layout::{Limits, Node}, mouse::{self, Cursor}, overlay, renderer, touch, - widget::{tree, Tree}, - Alignment, Clipboard, Element, Layout, Length, Padding, Rectangle, Shell, Widget, + widget::{Tree, tree}, }; /// A `MenuBar` collects `MenuTree`s and handles all the layout, event processing, and drawing. diff --git a/src/widget/menu/menu_inner.rs b/src/widget/menu/menu_inner.rs index 1cd60de..f8c0471 100644 --- a/src/widget/menu/menu_inner.rs +++ b/src/widget/menu/menu_inner.rs @@ -6,12 +6,11 @@ use crate::style::menu_bar::StyleSheet; use iced_core::{Border, Shadow}; use iced_widget::core::{ - event, + Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, event, layout::{Limits, Node}, mouse::{self, Cursor}, overlay, renderer, touch, widget::Tree, - Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, Size, Vector, }; /// The condition of when to close a menu diff --git a/src/widget/menu/menu_tree.rs b/src/widget/menu/menu_tree.rs index 86ed0df..d3ff8f1 100644 --- a/src/widget/menu/menu_tree.rs +++ b/src/widget/menu/menu_tree.rs @@ -6,12 +6,12 @@ use std::borrow::Cow; use std::collections::HashMap; use std::rc::Rc; -use iced_widget::core::{renderer, Element}; +use iced_widget::core::{Element, renderer}; use crate::iced_core::{Alignment, Length}; use crate::widget::menu::action::MenuAction; use crate::widget::menu::key_bind::KeyBind; -use crate::widget::{icon, Button}; +use crate::widget::{Button, icon}; use crate::{theme, widget}; /// Nested menu is essentially a tree of items, a menu is a collection of items diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 75a3191..276435f 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -48,46 +48,46 @@ // Re-exports from Iced #[doc(inline)] -pub use iced::widget::{canvas, Canvas}; +pub use iced::widget::{Canvas, canvas}; #[doc(inline)] -pub use iced::widget::{checkbox, Checkbox}; +pub use iced::widget::{Checkbox, checkbox}; #[doc(inline)] -pub use iced::widget::{combo_box, ComboBox}; +pub use iced::widget::{ComboBox, combo_box}; #[doc(inline)] -pub use iced::widget::{container, Container}; +pub use iced::widget::{Container, container}; #[doc(inline)] -pub use iced::widget::{horizontal_space, vertical_space, Space}; +pub use iced::widget::{Space, horizontal_space, vertical_space}; #[doc(inline)] -pub use iced::widget::{image, Image}; +pub use iced::widget::{Image, image}; #[doc(inline)] -pub use iced::widget::{lazy, Lazy}; +pub use iced::widget::{Lazy, lazy}; #[doc(inline)] -pub use iced::widget::{mouse_area, MouseArea}; +pub use iced::widget::{MouseArea, mouse_area}; #[doc(inline)] -pub use iced::widget::{pane_grid, PaneGrid}; +pub use iced::widget::{PaneGrid, pane_grid}; #[doc(inline)] -pub use iced::widget::{progress_bar, ProgressBar}; +pub use iced::widget::{ProgressBar, progress_bar}; #[doc(inline)] -pub use iced::widget::{responsive, Responsive}; +pub use iced::widget::{Responsive, responsive}; #[doc(inline)] -pub use iced::widget::{slider, vertical_slider, Slider, VerticalSlider}; +pub use iced::widget::{Slider, VerticalSlider, slider, vertical_slider}; #[doc(inline)] -pub use iced::widget::{svg, Svg}; +pub use iced::widget::{Svg, svg}; #[doc(inline)] -pub use iced::widget::{text_editor, TextEditor}; +pub use iced::widget::{TextEditor, text_editor}; #[doc(inline)] pub use iced_core::widget::{Id, Operation, Widget}; @@ -113,7 +113,7 @@ pub(crate) mod common; pub mod calendar; #[doc(inline)] -pub use calendar::{calendar, Calendar}; +pub use calendar::{Calendar, calendar}; pub mod card; #[doc(inline)] @@ -129,10 +129,10 @@ pub use iced::widget::qr_code; pub mod context_drawer; #[doc(inline)] -pub use context_drawer::{context_drawer, ContextDrawer}; +pub use context_drawer::{ContextDrawer, context_drawer}; #[doc(inline)] -pub use column::{column, Column}; +pub use column::{Column, column}; pub mod column { //! A container which aligns its children in a column. @@ -159,21 +159,21 @@ pub mod column { pub mod layer_container; #[doc(inline)] -pub use layer_container::{layer_container, LayerContainer}; +pub use layer_container::{LayerContainer, layer_container}; pub mod context_menu; #[doc(inline)] -pub use context_menu::{context_menu, ContextMenu}; +pub use context_menu::{ContextMenu, context_menu}; pub mod dialog; #[doc(inline)] -pub use dialog::{dialog, Dialog}; +pub use dialog::{Dialog, dialog}; /// An element to distinguish a boundary between two elements. pub mod divider { /// Horizontal variant of a divider. pub mod horizontal { - use iced::widget::{horizontal_rule, Rule}; + use iced::widget::{Rule, horizontal_rule}; /// Horizontal divider with default thickness #[must_use] @@ -196,7 +196,7 @@ pub mod divider { /// Vertical variant of a divider. pub mod vertical { - use iced::widget::{vertical_rule, Rule}; + use iced::widget::{Rule, vertical_rule}; /// Vertical divider with default thickness #[must_use] @@ -220,35 +220,35 @@ pub mod divider { pub mod dnd_destination; #[doc(inline)] -pub use dnd_destination::{dnd_destination, DndDestination}; +pub use dnd_destination::{DndDestination, dnd_destination}; pub mod dnd_source; #[doc(inline)] -pub use dnd_source::{dnd_source, DndSource}; +pub use dnd_source::{DndSource, dnd_source}; pub mod dropdown; #[doc(inline)] -pub use dropdown::{dropdown, Dropdown}; +pub use dropdown::{Dropdown, dropdown}; pub mod flex_row; #[doc(inline)] -pub use flex_row::{flex_row, FlexRow}; +pub use flex_row::{FlexRow, flex_row}; pub mod grid; #[doc(inline)] -pub use grid::{grid, Grid}; +pub use grid::{Grid, grid}; mod header_bar; #[doc(inline)] -pub use header_bar::{header_bar, HeaderBar}; +pub use header_bar::{HeaderBar, header_bar}; pub mod icon; #[doc(inline)] -pub use icon::{icon, Icon}; +pub use icon::{Icon, icon}; pub mod id_container; #[doc(inline)] -pub use id_container::{id_container, IdContainer}; +pub use id_container::{IdContainer, id_container}; #[cfg(feature = "animated-image")] pub mod frames; @@ -257,7 +257,7 @@ pub use taffy::JustifyContent; pub mod list; #[doc(inline)] -pub use list::{list_column, ListColumn}; +pub use list::{ListColumn, list_column}; pub mod menu; @@ -267,22 +267,22 @@ pub use nav_bar::{nav_bar, nav_bar_dnd}; pub mod nav_bar_toggle; #[doc(inline)] -pub use nav_bar_toggle::{nav_bar_toggle, NavBarToggle}; +pub use nav_bar_toggle::{NavBarToggle, nav_bar_toggle}; pub mod popover; #[doc(inline)] -pub use popover::{popover, Popover}; +pub use popover::{Popover, popover}; pub mod radio; #[doc(inline)] -pub use radio::{radio, Radio}; +pub use radio::{Radio, radio}; pub mod rectangle_tracker; #[doc(inline)] -pub use rectangle_tracker::{rectangle_tracking_container, RectangleTracker}; +pub use rectangle_tracker::{RectangleTracker, rectangle_tracking_container}; #[doc(inline)] -pub use row::{row, Row}; +pub use row::{Row, row}; pub mod row { //! A container which aligns its children in a row. @@ -319,30 +319,30 @@ pub mod settings; pub mod spin_button; #[doc(inline)] -pub use spin_button::{spin_button, vertical as vertical_spin_button, SpinButton}; +pub use spin_button::{SpinButton, spin_button, vertical as vertical_spin_button}; pub mod tab_bar; pub mod text; #[doc(inline)] -pub use text::{text, Text}; +pub use text::{Text, text}; pub mod text_input; #[doc(inline)] pub use text_input::{ - editable_input, inline_input, search_input, secure_input, text_input, TextInput, + TextInput, editable_input, inline_input, search_input, secure_input, text_input, }; pub mod toaster; #[doc(inline)] -pub use toaster::{toaster, Toast, ToastId, Toasts}; +pub use toaster::{Toast, ToastId, Toasts, toaster}; mod toggler; #[doc(inline)] pub use toggler::toggler; #[doc(inline)] -pub use tooltip::{tooltip, Tooltip}; +pub use tooltip::{Tooltip, tooltip}; #[cfg(all(feature = "wayland", feature = "winit"))] pub mod wayland; diff --git a/src/widget/nav_bar_toggle.rs b/src/widget/nav_bar_toggle.rs index dd4b788..23495e3 100644 --- a/src/widget/nav_bar_toggle.rs +++ b/src/widget/nav_bar_toggle.rs @@ -3,7 +3,7 @@ //! A button for toggling the navigation side panel. -use crate::{widget, Element}; +use crate::{Element, widget}; use derive_setters::Setters; #[derive(Setters)] diff --git a/src/widget/popover.rs b/src/widget/popover.rs index 12a64d0..30d5828 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -9,7 +9,7 @@ use iced_core::mouse; use iced_core::overlay; use iced_core::renderer; use iced_core::touch; -use iced_core::widget::{tree, Operation, Tree}; +use iced_core::widget::{Operation, Tree, tree}; use iced_core::{ Clipboard, Element, Layout, Length, Point, Rectangle, Shell, Size, Vector, Widget, }; diff --git a/src/widget/rectangle_tracker/mod.rs b/src/widget/rectangle_tracker/mod.rs index 3e7753e..632578f 100644 --- a/src/widget/rectangle_tracker/mod.rs +++ b/src/widget/rectangle_tracker/mod.rs @@ -1,8 +1,8 @@ mod subscription; +use iced::Vector; use iced::futures::channel::mpsc::UnboundedSender; use iced::widget::Container; -use iced::Vector; pub use subscription::*; use iced_core::event::{self, Event}; diff --git a/src/widget/responsive_container.rs b/src/widget/responsive_container.rs index 2f15a88..92bedef 100644 --- a/src/widget/responsive_container.rs +++ b/src/widget/responsive_container.rs @@ -6,7 +6,7 @@ use iced_core::layout; use iced_core::mouse; use iced_core::overlay; use iced_core::renderer; -use iced_core::widget::{tree, Id, Tree}; +use iced_core::widget::{Id, Tree, tree}; use iced_core::{Clipboard, Element, Layout, Length, Rectangle, Shell, Vector, Widget}; pub(crate) fn responsive_container<'a, Message: 'static, Theme, E>( diff --git a/src/widget/responsive_menu_bar.rs b/src/widget/responsive_menu_bar.rs index 3885710..41f9eae 100644 --- a/src/widget/responsive_menu_bar.rs +++ b/src/widget/responsive_menu_bar.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use apply::Apply; use crate::{ - widget::{button, icon, responsive_container}, Core, Element, + widget::{button, icon, responsive_container}, }; use super::menu; diff --git a/src/widget/segmented_button/mod.rs b/src/widget/segmented_button/mod.rs index 34b6ec7..e609d70 100644 --- a/src/widget/segmented_button/mod.rs +++ b/src/widget/segmented_button/mod.rs @@ -79,14 +79,14 @@ mod style; mod vertical; mod widget; -pub use self::horizontal::{horizontal, HorizontalSegmentedButton}; +pub use self::horizontal::{HorizontalSegmentedButton, horizontal}; pub use self::model::{ BuilderEntity, Entity, EntityMut, Model, ModelBuilder, MultiSelect, MultiSelectEntityMut, MultiSelectModel, Selectable, SingleSelect, SingleSelectEntityMut, SingleSelectModel, }; pub use self::style::{Appearance, ItemAppearance, ItemStatusAppearance, StyleSheet}; -pub use self::vertical::{vertical, VerticalSegmentedButton}; -pub use self::widget::{focus, Id, SegmentedButton, SegmentedVariant}; +pub use self::vertical::{VerticalSegmentedButton, vertical}; +pub use self::widget::{Id, SegmentedButton, SegmentedVariant, focus}; /// Associates extra data with an external secondary map. /// diff --git a/src/widget/segmented_button/style.rs b/src/widget/segmented_button/style.rs index 30fa336..102b368 100644 --- a/src/widget/segmented_button/style.rs +++ b/src/widget/segmented_button/style.rs @@ -1,7 +1,7 @@ // Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 -use iced_core::{border::Radius, Background, Color}; +use iced_core::{Background, Color, border::Radius}; /// Appearance of the segmented button. #[derive(Default, Clone, Copy)] diff --git a/src/widget/settings/item.rs b/src/widget/settings/item.rs index 0a5406f..6aa4e76 100644 --- a/src/widget/settings/item.rs +++ b/src/widget/settings/item.rs @@ -4,12 +4,11 @@ use std::borrow::Cow; use crate::{ - theme, - widget::{column, container, flex_row, horizontal_space, row, text, FlexRow, Row}, - Element, + Element, theme, + widget::{FlexRow, Row, column, container, flex_row, horizontal_space, row, text}, }; use derive_setters::Setters; -use iced_core::{text::Wrapping, Length}; +use iced_core::{Length, text::Wrapping}; use taffy::AlignContent; /// A settings item aligned in a row diff --git a/src/widget/settings/mod.rs b/src/widget/settings/mod.rs index 805e58c..984dd08 100644 --- a/src/widget/settings/mod.rs +++ b/src/widget/settings/mod.rs @@ -5,10 +5,10 @@ pub mod item; pub mod section; pub use self::item::{flex_item, flex_item_row, item, item_row}; -pub use self::section::{section, Section}; +pub use self::section::{Section, section}; -use crate::widget::{column, Column}; -use crate::{theme, Element}; +use crate::widget::{Column, column}; +use crate::{Element, theme}; /// A column with a predefined style for creating a settings panel #[must_use] diff --git a/src/widget/settings/section.rs b/src/widget/settings/section.rs index 71b9a92..bc88500 100644 --- a/src/widget/settings/section.rs +++ b/src/widget/settings/section.rs @@ -1,8 +1,8 @@ // Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 -use crate::widget::{column, text, ListColumn}; use crate::Element; +use crate::widget::{ListColumn, column, text}; use std::borrow::Cow; /// A section within a settings view column. diff --git a/src/widget/spin_button.rs b/src/widget/spin_button.rs index 8739342..1a2f3e0 100644 --- a/src/widget/spin_button.rs +++ b/src/widget/spin_button.rs @@ -4,9 +4,8 @@ //! A control for incremental adjustments of a value. use crate::{ - theme, + Element, theme, widget::{button, column, container, icon, row, text}, - Element, }; use apply::Apply; use iced::{Alignment, Length}; diff --git a/src/widget/text_input/style.rs b/src/widget/text_input/style.rs index aa25c86..8af5e63 100644 --- a/src/widget/text_input/style.rs +++ b/src/widget/text_input/style.rs @@ -4,7 +4,7 @@ //! Change the appearance of a text input. -use iced_core::{border::Radius, Background, Color}; +use iced_core::{Background, Color, border::Radius}; /// The appearance of a text input. #[derive(Debug, Clone, Copy)] diff --git a/src/widget/toaster/widget.rs b/src/widget/toaster/widget.rs index bde5c89..f6324e1 100644 --- a/src/widget/toaster/widget.rs +++ b/src/widget/toaster/widget.rs @@ -4,15 +4,15 @@ use iced::{Limits, Size}; use iced_core::layout::Node; +use iced_core::Element; +use iced_core::Overlay; use iced_core::event::{self, Event}; use iced_core::layout; use iced_core::mouse; use iced_core::overlay; use iced_core::renderer::{self}; -use iced_core::widget::tree::Tree; use iced_core::widget::Operation; -use iced_core::Element; -use iced_core::Overlay; +use iced_core::widget::tree::Tree; use iced_core::{Clipboard, Layout, Length, Point, Rectangle, Shell, Vector, Widget}; pub struct Toaster<'a, Message, Theme, Renderer> { diff --git a/src/widget/toggler.rs b/src/widget/toggler.rs index 47656a0..65179d9 100644 --- a/src/widget/toggler.rs +++ b/src/widget/toggler.rs @@ -1,7 +1,7 @@ // Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 -use iced::{widget, Length}; +use iced::{Length, widget}; use iced_core::text; pub fn toggler<'a, Message, Theme: iced_widget::toggler::Catalog, Renderer>( diff --git a/src/widget/warning.rs b/src/widget/warning.rs index f05a08f..942ffb8 100644 --- a/src/widget/warning.rs +++ b/src/widget/warning.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 use super::icon; -use crate::{theme, widget, Element, Renderer, Theme}; +use crate::{Element, Renderer, Theme, theme, widget}; use apply::Apply; use iced::{Alignment, Background, Color, Length}; use iced_core::{Border, Shadow}; diff --git a/src/widget/wayland/tooltip/mod.rs b/src/widget/wayland/tooltip/mod.rs index 79a2fda..947d1e8 100644 --- a/src/widget/wayland/tooltip/mod.rs +++ b/src/widget/wayland/tooltip/mod.rs @@ -5,7 +5,7 @@ pub mod widget; // Copyright 2023 System76 // SPDX-License-Identifier: MPL-2.0 -use iced_core::{border::Radius, Background, Color, Vector}; +use iced_core::{Background, Color, Vector, border::Radius}; use crate::theme::THEME; diff --git a/src/widget/wayland/tooltip/widget.rs b/src/widget/wayland/tooltip/widget.rs index 35dd14d..5194d5c 100644 --- a/src/widget/wayland/tooltip/widget.rs +++ b/src/widget/wayland/tooltip/widget.rs @@ -16,14 +16,14 @@ use iced_runtime::core::widget::Id; use iced_core::event::{self, Event}; use iced_core::renderer; use iced_core::touch; -use iced_core::widget::tree::{self, Tree}; use iced_core::widget::Operation; -use iced_core::{layout, svg}; -use iced_core::{mouse, Border}; -use iced_core::{overlay, Shadow}; +use iced_core::widget::tree::{self, Tree}; use iced_core::{ Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget, }; +use iced_core::{Border, mouse}; +use iced_core::{Shadow, overlay}; +use iced_core::{layout, svg}; pub use super::{Catalog, Style}; @@ -75,14 +75,14 @@ impl<'a, Message, TopLevelMessage> Tooltip<'a, Message, TopLevelMessage> { content: impl Into>, settings: Option< impl Fn(Rectangle) -> iced_runtime::platform_specific::wayland::popup::SctkPopupSettings - + Send - + Sync - + 'static, - >, - view: impl Fn() -> crate::Element<'static, crate::Action> + Send + Sync + 'static, + >, + view: impl Fn() -> crate::Element<'static, crate::Action> + + Send + + Sync + + 'static, on_leave: Message, on_surface_action: impl Fn(crate::surface::Action) -> Message + 'static, ) -> Self { diff --git a/src/widget/wrapper.rs b/src/widget/wrapper.rs index 219254c..0579c4b 100644 --- a/src/widget/wrapper.rs +++ b/src/widget/wrapper.rs @@ -5,8 +5,8 @@ use std::{ }; use crate::Element; -use iced::{event, Length, Rectangle, Size}; -use iced_core::{id::Id, widget, widget::tree, Widget}; +use iced::{Length, Rectangle, Size, event}; +use iced_core::{Widget, id::Id, widget, widget::tree}; #[derive(Debug)] pub struct RcWrapper {