summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs12
-rw-r--r--src/window/icon.rs3
-rw-r--r--src/window/settings.rs10
3 files changed, 13 insertions, 12 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c73cc48d..ce6c513d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -163,7 +163,7 @@
)]
#![forbid(rust_2018_idioms, unsafe_code)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
-#![cfg_attr(docsrs, feature(doc_cfg))]
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use iced_widget::graphics;
use iced_widget::renderer;
use iced_widget::style;
@@ -188,9 +188,10 @@ 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, Color, ContentFit, Length, Padding, Pixels,
- Point, Rectangle, Size, Vector,
+ color, Alignment, Background, Color, ContentFit, Degrees, Gradient, Length,
+ Padding, Pixels, Point, Radians, Rectangle, Size, Vector,
};
pub use crate::runtime::Command;
@@ -229,7 +230,9 @@ pub mod keyboard {
pub mod mouse {
//! Listen and react to mouse events.
- pub use crate::core::mouse::{Button, Event, Interaction, ScrollDelta};
+ pub use crate::core::mouse::{
+ Button, Cursor, Event, Interaction, ScrollDelta,
+ };
}
pub mod subscription {
@@ -275,6 +278,7 @@ pub mod widget {
mod native {}
mod renderer {}
mod style {}
+ mod runtime {}
}
pub use application::Application;
diff --git a/src/window/icon.rs b/src/window/icon.rs
index b67b2ea3..0fe010ca 100644
--- a/src/window/icon.rs
+++ b/src/window/icon.rs
@@ -12,7 +12,6 @@ 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")]
-#[cfg_attr(docsrs, doc(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();
@@ -24,7 +23,6 @@ pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
/// This content can be included in your application at compile-time, e.g. using the `include_bytes!` macro.
/// You can pass an explicit file format. Otherwise, the file format will be guessed at runtime.
#[cfg(feature = "image")]
-#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
pub fn from_file_data(
data: &[u8],
explicit_format: Option<image_rs::ImageFormat>,
@@ -60,7 +58,6 @@ pub enum Error {
/// The `image` crate reported an error.
#[cfg(feature = "image")]
- #[cfg_attr(docsrs, doc(cfg(feature = "image")))]
#[error("Unable to create icon from a file: {0}")]
ImageError(#[from] image_rs::error::ImageError),
}
diff --git a/src/window/settings.rs b/src/window/settings.rs
index 3c8da62f..458b9232 100644
--- a/src/window/settings.rs
+++ b/src/window/settings.rs
@@ -1,4 +1,4 @@
-use crate::window::{Icon, Position};
+use crate::window::{Icon, Level, Position};
pub use iced_winit::settings::PlatformSpecific;
@@ -29,8 +29,8 @@ pub struct Settings {
/// Whether the window should be transparent.
pub transparent: bool,
- /// Whether the window will always be on top of other windows.
- pub always_on_top: bool,
+ /// The window [`Level`].
+ pub level: Level,
/// The icon of the window.
pub icon: Option<Icon>,
@@ -50,7 +50,7 @@ impl Default for Settings {
resizable: true,
decorations: true,
transparent: false,
- always_on_top: false,
+ level: Level::default(),
icon: None,
platform_specific: Default::default(),
}
@@ -68,7 +68,7 @@ impl From<Settings> for iced_winit::settings::Window {
resizable: settings.resizable,
decorations: settings.decorations,
transparent: settings.transparent,
- always_on_top: settings.always_on_top,
+ level: settings.level,
icon: settings.icon.map(Icon::into),
platform_specific: settings.platform_specific,
}