summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs16
-rw-r--r--src/window/icon.rs9
2 files changed, 16 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 36f48ba2..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
@@ -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,
};
}
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<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
- 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<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
#[cfg(feature = "image")]
pub fn from_file_data(
data: &[u8],
- explicit_format: Option<image_rs::ImageFormat>,
+ explicit_format: Option<image::ImageFormat>,
) -> Result<Icon, Error> {
- 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),
}