From a9b95f39dd8f55b00b5f4b2f6690c05b5a921d4d Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Thu, 27 Jul 2023 04:27:19 +0200 Subject: add border radius to public API --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index ce6c513d..174fd890 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -191,7 +191,7 @@ pub use crate::core::event; pub use crate::core::gradient; pub use crate::core::{ color, Alignment, Background, Color, ContentFit, Degrees, Gradient, Length, - Padding, Pixels, Point, Radians, Rectangle, Size, Vector, + Padding, Pixels, Point, Radians, Rectangle, Size, Vector, BorderRadius }; pub use crate::runtime::Command; -- cgit From 274fae5aff5dbfce59cec3eaa4893d1ed6b7e459 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 27 Jul 2023 18:50:56 +0200 Subject: Run `cargo fmt` --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 174fd890..0905a31c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -190,8 +190,8 @@ pub use crate::core::alignment; pub use crate::core::event; pub use crate::core::gradient; pub use crate::core::{ - color, Alignment, Background, Color, ContentFit, Degrees, Gradient, Length, - Padding, Pixels, Point, Radians, Rectangle, Size, Vector, BorderRadius + color, Alignment, Background, BorderRadius, Color, ContentFit, Degrees, + Gradient, Length, Padding, Pixels, Point, Radians, Rectangle, Size, Vector, }; pub use crate::runtime::Command; -- cgit From 126aef88e7647c4690055b4c96aee46ecadcf60e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jul 2023 19:48:39 +0200 Subject: Bump versions :tada: --- src/application.rs | 18 +++++++++--------- src/lib.rs | 8 ++++---- src/sandbox.rs | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/application.rs b/src/application.rs index abf58fa3..9518b8c5 100644 --- a/src/application.rs +++ b/src/application.rs @@ -39,15 +39,15 @@ pub use crate::style::application::{Appearance, StyleSheet}; /// to listen to time. /// - [`todos`], a todos tracker inspired by [TodoMVC]. /// -/// [The repository has a bunch of examples]: https://github.com/iced-rs/iced/tree/0.9/examples -/// [`clock`]: https://github.com/iced-rs/iced/tree/0.9/examples/clock -/// [`download_progress`]: https://github.com/iced-rs/iced/tree/0.9/examples/download_progress -/// [`events`]: https://github.com/iced-rs/iced/tree/0.9/examples/events -/// [`game_of_life`]: https://github.com/iced-rs/iced/tree/0.9/examples/game_of_life -/// [`pokedex`]: https://github.com/iced-rs/iced/tree/0.9/examples/pokedex -/// [`solar_system`]: https://github.com/iced-rs/iced/tree/0.9/examples/solar_system -/// [`stopwatch`]: https://github.com/iced-rs/iced/tree/0.9/examples/stopwatch -/// [`todos`]: https://github.com/iced-rs/iced/tree/0.9/examples/todos +/// [The repository has a bunch of examples]: https://github.com/iced-rs/iced/tree/0.10/examples +/// [`clock`]: https://github.com/iced-rs/iced/tree/0.10/examples/clock +/// [`download_progress`]: https://github.com/iced-rs/iced/tree/0.10/examples/download_progress +/// [`events`]: https://github.com/iced-rs/iced/tree/0.10/examples/events +/// [`game_of_life`]: https://github.com/iced-rs/iced/tree/0.10/examples/game_of_life +/// [`pokedex`]: https://github.com/iced-rs/iced/tree/0.10/examples/pokedex +/// [`solar_system`]: https://github.com/iced-rs/iced/tree/0.10/examples/solar_system +/// [`stopwatch`]: https://github.com/iced-rs/iced/tree/0.10/examples/stopwatch +/// [`todos`]: https://github.com/iced-rs/iced/tree/0.10/examples/todos /// [`Sandbox`]: crate::Sandbox /// [`Canvas`]: crate::widget::Canvas /// [PokéAPI]: https://pokeapi.co/ diff --git a/src/lib.rs b/src/lib.rs index 0905a31c..19e7456e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,13 +24,13 @@ //! [scrollables]: https://gfycat.com/perkybaggybaboon-rust-gui //! [Debug overlay with performance metrics]: https://gfycat.com/incredibledarlingbee //! [Modular ecosystem]: https://github.com/iced-rs/iced/blob/master/ECOSYSTEM.md -//! [renderer-agnostic native runtime]: https://github.com/iced-rs/iced/tree/0.9/native +//! [renderer-agnostic native runtime]: https://github.com/iced-rs/iced/tree/0.10/runtime //! [`wgpu`]: https://github.com/gfx-rs/wgpu-rs -//! [built-in renderer]: https://github.com/iced-rs/iced/tree/0.9/wgpu -//! [windowing shell]: https://github.com/iced-rs/iced/tree/0.9/winit +//! [built-in renderer]: https://github.com/iced-rs/iced/tree/0.10/wgpu +//! [windowing shell]: https://github.com/iced-rs/iced/tree/0.10/winit //! [`dodrio`]: https://github.com/fitzgen/dodrio //! [web runtime]: https://github.com/iced-rs/iced_web -//! [examples]: https://github.com/iced-rs/iced/tree/0.9/examples +//! [examples]: https://github.com/iced-rs/iced/tree/0.10/examples //! [repository]: https://github.com/iced-rs/iced //! //! # Overview diff --git a/src/sandbox.rs b/src/sandbox.rs index cca327b6..825a0b60 100644 --- a/src/sandbox.rs +++ b/src/sandbox.rs @@ -34,19 +34,19 @@ use crate::{Application, Command, Element, Error, Settings, Subscription}; /// - [`tour`], a simple UI tour that can run both on native platforms and the /// web! /// -/// [The repository has a bunch of examples]: https://github.com/iced-rs/iced/tree/0.9/examples -/// [`bezier_tool`]: https://github.com/iced-rs/iced/tree/0.9/examples/bezier_tool -/// [`counter`]: https://github.com/iced-rs/iced/tree/0.9/examples/counter -/// [`custom_widget`]: https://github.com/iced-rs/iced/tree/0.9/examples/custom_widget -/// [`geometry`]: https://github.com/iced-rs/iced/tree/0.9/examples/geometry -/// [`pane_grid`]: https://github.com/iced-rs/iced/tree/0.9/examples/pane_grid -/// [`progress_bar`]: https://github.com/iced-rs/iced/tree/0.9/examples/progress_bar -/// [`styling`]: https://github.com/iced-rs/iced/tree/0.9/examples/styling -/// [`svg`]: https://github.com/iced-rs/iced/tree/0.9/examples/svg -/// [`tour`]: https://github.com/iced-rs/iced/tree/0.9/examples/tour +/// [The repository has a bunch of examples]: https://github.com/iced-rs/iced/tree/0.10/examples +/// [`bezier_tool`]: https://github.com/iced-rs/iced/tree/0.10/examples/bezier_tool +/// [`counter`]: https://github.com/iced-rs/iced/tree/0.10/examples/counter +/// [`custom_widget`]: https://github.com/iced-rs/iced/tree/0.10/examples/custom_widget +/// [`geometry`]: https://github.com/iced-rs/iced/tree/0.10/examples/geometry +/// [`pane_grid`]: https://github.com/iced-rs/iced/tree/0.10/examples/pane_grid +/// [`progress_bar`]: https://github.com/iced-rs/iced/tree/0.10/examples/progress_bar +/// [`styling`]: https://github.com/iced-rs/iced/tree/0.10/examples/styling +/// [`svg`]: https://github.com/iced-rs/iced/tree/0.10/examples/svg +/// [`tour`]: https://github.com/iced-rs/iced/tree/0.10/examples/tour /// [`Canvas widget`]: crate::widget::Canvas /// [the overview]: index.html#overview -/// [`iced_wgpu`]: https://github.com/iced-rs/iced/tree/0.9/wgpu +/// [`iced_wgpu`]: https://github.com/iced-rs/iced/tree/0.10/wgpu /// [`Svg` widget]: crate::widget::Svg /// [Ghostscript Tiger]: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg /// -- cgit From c9c5be7b01fbf4c09368cba278942e4a9d985871 Mon Sep 17 00:00:00 2001 From: Bartłomiej Maryńczak Date: Wed, 16 Aug 2023 20:21:57 +0200 Subject: [docs] Don't use &mut self for view() --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 19e7456e..ff87e245 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,7 +86,7 @@ //! use iced::widget::{button, column, text, Column}; //! //! impl Counter { -//! pub fn view(&mut self) -> Column { +//! pub fn view(&self) -> Column { //! // We use a column: a simple vertical layout //! column![ //! // The increment button. We tell it to produce an -- cgit From 8ed06dc356e0296f0b800d4d6b92998bd4444cc6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 26 Aug 2023 01:34:42 +0200 Subject: Fix `clippy` lints for Rust 1.72 --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index ff87e245..36f48ba2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -268,6 +268,7 @@ pub mod touch { pub use crate::core::touch::{Event, Finger}; } +#[allow(hidden_glob_reexports)] pub mod widget { //! Use the built-in widgets or create your own. pub use iced_widget::*; -- cgit From ed3454301e663a7cb7d73cd56b57b188f4d14a2f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 30 Aug 2023 04:31:21 +0200 Subject: Implement explicit text caching in the widget state tree --- src/settings.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/settings.rs b/src/settings.rs index 0dd46584..794f89fd 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,6 +1,6 @@ //! Configure your application. use crate::window; -use crate::Font; +use crate::{Font, Pixels}; /// The settings of an application. #[derive(Debug, Clone)] @@ -29,7 +29,7 @@ pub struct Settings { /// The text size that will be used by default. /// /// The default value is `16.0`. - pub default_text_size: f32, + pub default_text_size: Pixels, /// If set to true, the renderer will try to perform antialiasing for some /// primitives. @@ -80,7 +80,7 @@ where window: Default::default(), flags: Default::default(), default_font: Default::default(), - default_text_size: 16.0, + default_text_size: Pixels(16.0), antialiasing: false, exit_on_close_request: true, } -- cgit From f468e25d0c67a01ee79d892f6e8ba9be019f06c7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 4 Sep 2023 12:58:41 +0200 Subject: Use workspace dependencies and package inheritance We are also taking this as a chance to synchronize the versions of all the crates! Because of this, we will skip the `0.11` version. --- src/window/icon.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/window/icon.rs b/src/window/icon.rs index 0fe010ca..0cb206b3 100644 --- a/src/window/icon.rs +++ b/src/window/icon.rs @@ -13,7 +13,7 @@ use std::path::Path; /// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead. #[cfg(feature = "image")] pub fn from_file>(icon_path: P) -> Result { - let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8(); + let icon = image::io::Reader::open(icon_path)?.decode()?.to_rgba8(); Ok(icon::from_rgba(icon.to_vec(), icon.width(), icon.height())?) } @@ -25,9 +25,10 @@ pub fn from_file>(icon_path: P) -> Result { #[cfg(feature = "image")] pub fn from_file_data( data: &[u8], - explicit_format: Option, + explicit_format: Option, ) -> Result { - let mut icon = image_rs::io::Reader::new(std::io::Cursor::new(data)); + let mut icon = image::io::Reader::new(std::io::Cursor::new(data)); + let icon_with_format = match explicit_format { Some(format) => { icon.set_format(format); @@ -59,5 +60,5 @@ pub enum Error { /// The `image` crate reported an error. #[cfg(feature = "image")] #[error("Unable to create icon from a file: {0}")] - ImageError(#[from] image_rs::error::ImageError), + ImageError(#[from] image::error::ImageError), } -- cgit From 08a031cbe5913c249efa7fc82556d5d95f981c4c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 7 Sep 2023 02:45:15 +0200 Subject: Introduce `keyboard::on_key_press` and `on_key_release` Also rename `subscription::events*` to `event::listen*`. --- src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 36f48ba2..840802cc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -187,7 +187,6 @@ pub mod advanced; pub use style::theme; pub use crate::core::alignment; -pub use crate::core::event; pub use crate::core::gradient; pub use crate::core::{ color, Alignment, Background, BorderRadius, Color, ContentFit, Degrees, @@ -223,9 +222,16 @@ pub mod font { pub use crate::runtime::font::*; } +pub mod event { + //! Handle events of a user interface. + pub use crate::core::event::{Event, MacOS, PlatformSpecific, Status}; + pub use iced_futures::event::{listen, listen_raw, listen_with}; +} + pub mod keyboard { //! Listen and react to keyboard events. pub use crate::core::keyboard::{Event, KeyCode, Modifiers}; + pub use iced_futures::keyboard::{on_key_press, on_key_release}; } pub mod mouse { @@ -238,7 +244,7 @@ pub mod mouse { pub mod subscription { //! Listen to external events in your application. pub use iced_futures::subscription::{ - channel, events, events_with, run, run_with_id, unfold, Subscription, + channel, run, run_with_id, unfold, Subscription, }; } -- cgit From 6fd2c1552735639d96d177550e98b314bd6f79a8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 7 Sep 2023 05:05:43 +0200 Subject: Host GIFs and video examples in `iced.rs` RIP Gfycat --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 840802cc..91c78423 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,9 +20,9 @@ //! Check out the [repository] and the [examples] for more details! //! //! [Cross-platform support]: https://github.com/iced-rs/iced/blob/master/docs/images/todos_desktop.jpg?raw=true -//! [text inputs]: https://gfycat.com/alertcalmcrow-rust-gui -//! [scrollables]: https://gfycat.com/perkybaggybaboon-rust-gui -//! [Debug overlay with performance metrics]: https://gfycat.com/incredibledarlingbee +//! [text inputs]: https://iced.rs/examples/text_input.mp4 +//! [scrollables]: https://iced.rs/examples/scrollable.mp4 +//! [Debug overlay with performance metrics]: https://iced.rs/examples/debug.mp4 //! [Modular ecosystem]: https://github.com/iced-rs/iced/blob/master/ECOSYSTEM.md //! [renderer-agnostic native runtime]: https://github.com/iced-rs/iced/tree/0.10/runtime //! [`wgpu`]: https://github.com/gfx-rs/wgpu-rs -- cgit From 89d9f1d7d2202029028a487df1dd11b0665a7517 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Sat, 9 Sep 2023 12:24:47 +0200 Subject: Fix majority of unresolved documentation links --- src/lib.rs | 6 +++--- src/settings.rs | 2 +- src/window/icon.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 91c78423..8780d276 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,11 +258,11 @@ pub mod system { pub mod overlay { //! Display interactive elements on top of other widgets. - /// A generic [`Overlay`]. + /// A generic overlay. /// - /// This is an alias of an `iced_native` element with a default `Renderer`. + /// This is an alias of an [`overlay::Element`] with a default `Renderer`. /// - /// [`Overlay`]: iced_native::Overlay + /// [`overlay::Element`]: crate::core::overlay::Element pub type Element<'a, Message, Renderer = crate::Renderer> = crate::core::overlay::Element<'a, Message, Renderer>; diff --git a/src/settings.rs b/src/settings.rs index 0dd46584..8659603c 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -23,7 +23,7 @@ pub struct Settings { /// The default [`Font`] to be used. /// - /// By default, it uses [`Font::SansSerif`]. + /// By default, it uses [`Family::SansSerif`](crate::font::Family::SansSerif). pub default_font: Font, /// The text size that will be used by default. diff --git a/src/window/icon.rs b/src/window/icon.rs index 0cb206b3..ef71c228 100644 --- a/src/window/icon.rs +++ b/src/window/icon.rs @@ -10,7 +10,7 @@ use std::path::Path; /// Creates an icon from an image file. /// -/// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead. +/// This will return an error in case the file is missing at run-time. You may prefer [`from_file_data`] instead. #[cfg(feature = "image")] pub fn from_file>(icon_path: P) -> Result { let icon = image::io::Reader::open(icon_path)?.decode()?.to_rgba8(); -- cgit From f60884f6f8639f75258c264bf4a15591351ef05b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Sep 2023 20:58:45 +0200 Subject: Deny `broken_intradoc_links` and verify documentation in CI --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 8780d276..3cbe716a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -151,6 +151,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(rust_2018_idioms, unsafe_code)] #![deny( missing_debug_implementations, missing_docs, @@ -159,9 +160,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(rust_2018_idioms, unsafe_code)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] use iced_widget::graphics; -- cgit From e7326f0af6f16cf2ff04fbac93bf296a044923f4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Sep 2023 19:07:41 +0200 Subject: Flesh out the `editor` example a bit more --- src/settings.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/settings.rs b/src/settings.rs index d9778d7e..6b9ce095 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -2,6 +2,8 @@ use crate::window; use crate::{Font, Pixels}; +use std::borrow::Cow; + /// The settings of an application. #[derive(Debug, Clone)] pub struct Settings { @@ -21,6 +23,9 @@ pub struct Settings { /// [`Application`]: crate::Application pub flags: Flags, + /// The fonts to load on boot. + pub fonts: Vec>, + /// The default [`Font`] to be used. /// /// By default, it uses [`Family::SansSerif`](crate::font::Family::SansSerif). @@ -62,6 +67,7 @@ impl Settings { flags, id: default_settings.id, window: default_settings.window, + fonts: default_settings.fonts, default_font: default_settings.default_font, default_text_size: default_settings.default_text_size, antialiasing: default_settings.antialiasing, @@ -79,6 +85,7 @@ where id: None, window: Default::default(), flags: Default::default(), + fonts: Default::default(), default_font: Default::default(), default_text_size: Pixels(16.0), antialiasing: false, @@ -93,6 +100,7 @@ impl From> for iced_winit::Settings { id: settings.id, window: settings.window.into(), flags: settings.flags, + fonts: settings.fonts, exit_on_close_request: settings.exit_on_close_request, } } -- cgit From f806d001e6fb44b5a45029ca257261e6e0d4d4b2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 19 Sep 2023 20:48:50 +0200 Subject: Introduce new `iced_highlighter` subcrate --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 3cbe716a..e435a041 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -174,6 +174,9 @@ use iced_winit::runtime; pub use iced_futures::futures; +#[cfg(feature = "highlighter")] +pub use iced_highlighter as highlighter; + mod error; mod sandbox; -- cgit From 42ed90bc6f92b2085d193e7f143430b8d3847c21 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Sep 2023 04:51:08 +0200 Subject: Fix `clippy::default_trait_access` --- src/settings.rs | 4 ++-- src/window/settings.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/settings.rs b/src/settings.rs index d9778d7e..c5e28e86 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -77,9 +77,9 @@ where fn default() -> Self { Self { id: None, - window: Default::default(), + window: window::Settings::default(), flags: Default::default(), - default_font: Default::default(), + default_font: Font::default(), default_text_size: Pixels(16.0), antialiasing: false, exit_on_close_request: true, diff --git a/src/window/settings.rs b/src/window/settings.rs index 458b9232..0ee573e5 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -52,7 +52,7 @@ impl Default for Settings { transparent: false, level: Level::default(), icon: None, - platform_specific: Default::default(), + platform_specific: PlatformSpecific::default(), } } } -- cgit From f137d71e8fb926e784680d56d1cfa6817c3710a1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Sep 2023 16:40:03 +0200 Subject: Centralize `clippy` lints in `.cargo/config.toml` --- src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 3cbe716a..cb6e86d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,14 +156,8 @@ missing_debug_implementations, missing_docs, unused_results, - clippy::extra_unused_lifetimes, - clippy::from_over_into, - clippy::needless_borrow, - clippy::new_without_default, - clippy::useless_conversion, rustdoc::broken_intra_doc_links )] -#![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] use iced_widget::graphics; use iced_widget::renderer; -- cgit From a761448858521d11dc646e2ef5217e9e06628932 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 29 Nov 2023 00:14:27 +0100 Subject: Implement `command::channel` helper It is analogous to `subscription::channel`. --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index f9f3952c..47766e6f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -190,7 +190,6 @@ pub use crate::core::{ color, Alignment, Background, BorderRadius, Color, ContentFit, Degrees, Gradient, Length, Padding, Pixels, Point, Radians, Rectangle, Size, Vector, }; -pub use crate::runtime::Command; pub mod clipboard { //! Access the clipboard. @@ -239,6 +238,11 @@ pub mod mouse { }; } +pub mod command { + //! Run asynchronous actions. + pub use crate::runtime::command::{channel, Command}; +} + pub mod subscription { //! Listen to external events in your application. pub use iced_futures::subscription::{ @@ -287,6 +291,7 @@ pub mod widget { } pub use application::Application; +pub use command::Command; pub use error::Error; pub use event::Event; pub use executor::Executor; -- cgit