diff options
| author | pml68 <contact@pml68.dev> | 2025-07-22 18:23:24 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-07-22 18:23:24 +0200 |
| commit | ef7985c177c5ec6fe4d26559eca14c9f0b8bc69d (patch) | |
| tree | ab49e7f2727e15de30a3b48e3ae6e25485b43f43 | |
| parent | chore: necessary updates for iced-rs/iced@e0d9078 (diff) | |
| download | iced_dialog-ef7985c177c5ec6fe4d26559eca14c9f0b8bc69d.tar.gz | |
style: organize imports
| -rw-r--r-- | src/dialog.rs | 15 | ||||
| -rw-r--r-- | src/lib.rs | 5 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/dialog.rs b/src/dialog.rs index c944e72..840800f 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -1,14 +1,13 @@ //! Dialogs can be used to provide users with //! important information and make them act on it. -use iced_core::{ - self as core, Color, Element, Length, Padding, Pixels, alignment, color, -}; use iced_widget::{ Container, Row, Theme, column, container, mouse_area, opaque, stack, text, text::{Fragment, IntoFragment}, vertical_space, }; +use crate::core::{self, Color, Element, Length, Padding, Pixels, alignment}; + /// A message dialog. /// /// Only the content is required, [`buttons`] and the [`title`] are optional. @@ -513,11 +512,7 @@ impl Catalog for Theme { } fn default_container<'a>() -> <Self as container::Catalog>::Class<'a> { - Box::new(|theme| { - container::background( - theme.extended_palette().background.base.color, - ) - }) + Box::new(|theme| container::background(theme.palette().background)) } fn style(&self, class: &<Self as Catalog>::Class<'_>) -> Style { @@ -526,8 +521,8 @@ impl Catalog for Theme { } /// The default style of a [`Dialog`]. -pub fn default(_theme: &Theme) -> Style { +pub fn default<Theme>(_theme: &Theme) -> Style { Style { - backdrop_color: color!(0x000000, 0.3), + backdrop_color: core::color!(0x000000, 0.3), } } @@ -1,9 +1,8 @@ #![doc = include_str!("../README.md")] pub mod dialog; pub use dialog::Dialog; -use iced_core as core; -use iced_core::alignment::Horizontal; use iced_widget::Button; +use iced_widget::core; use iced_widget::{container, text}; /// Creates a new [`Dialog`] with the given base and dialog content. @@ -37,7 +36,7 @@ where text(content) .size(14) .line_height(text::LineHeight::Absolute(core::Pixels(20.0))) - .align_x(Horizontal::Center), + .align_x(core::Alignment::Center), ) .on_press(message) .height(32) |
