diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/widget.rs | 10 | ||||
-rw-r--r-- | core/src/window/id.rs | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/core/src/widget.rs b/core/src/widget.rs index c5beea54..9cfff83d 100644 --- a/core/src/widget.rs +++ b/core/src/widget.rs @@ -33,12 +33,12 @@ use crate::{Clipboard, Length, Rectangle, Shell, Size, Vector}; /// - [`geometry`], a custom widget showcasing how to draw geometry with the /// `Mesh2D` primitive in [`iced_wgpu`]. /// -/// [examples]: https://github.com/iced-rs/iced/tree/0.12/examples -/// [`bezier_tool`]: https://github.com/iced-rs/iced/tree/0.12/examples/bezier_tool -/// [`custom_widget`]: https://github.com/iced-rs/iced/tree/0.12/examples/custom_widget -/// [`geometry`]: https://github.com/iced-rs/iced/tree/0.12/examples/geometry +/// [examples]: https://github.com/iced-rs/iced/tree/0.13/examples +/// [`bezier_tool`]: https://github.com/iced-rs/iced/tree/0.13/examples/bezier_tool +/// [`custom_widget`]: https://github.com/iced-rs/iced/tree/0.13/examples/custom_widget +/// [`geometry`]: https://github.com/iced-rs/iced/tree/0.13/examples/geometry /// [`lyon`]: https://github.com/nical/lyon -/// [`iced_wgpu`]: https://github.com/iced-rs/iced/tree/0.12/wgpu +/// [`iced_wgpu`]: https://github.com/iced-rs/iced/tree/0.13/wgpu pub trait Widget<Message, Theme, Renderer> where Renderer: crate::Renderer, diff --git a/core/src/window/id.rs b/core/src/window/id.rs index 31ea92f3..5d5a817e 100644 --- a/core/src/window/id.rs +++ b/core/src/window/id.rs @@ -1,11 +1,9 @@ +use std::fmt; use std::hash::Hash; - use std::sync::atomic::{self, AtomicU64}; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] /// The id of the window. -/// -/// Internally Iced reserves `window::Id::MAIN` for the first window spawned. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Id(u64); static COUNT: AtomicU64 = AtomicU64::new(1); @@ -16,3 +14,9 @@ impl Id { Id(COUNT.fetch_add(1, atomic::Ordering::Relaxed)) } } + +impl fmt::Display for Id { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.fmt(f) + } +} |