diff --git a/examples/application/Cargo.toml b/examples/application/Cargo.toml index b05d86a8..33ba4505 100644 --- a/examples/application/Cargo.toml +++ b/examples/application/Cargo.toml @@ -10,4 +10,4 @@ tracing-subscriber = "0.3.17" [dependencies.libcosmic] path = "../../" default-features = false -features = ["debug", "wayland", "tokio"] +features = ["debug", "winit", "tokio"] diff --git a/examples/application/src/main.rs b/examples/application/src/main.rs index 591556c7..e8d5fbe1 100644 --- a/examples/application/src/main.rs +++ b/examples/application/src/main.rs @@ -40,7 +40,7 @@ fn main() -> Result<(), Box> { .antialiasing(true) .client_decorations(true) .debug(false) - .default_icon_theme(Some("Pop".into())) + .default_icon_theme("Pop") .default_text_size(16.0) .scale_factor(1.0) .size((1024, 768)) diff --git a/src/command/mod.rs b/src/command/mod.rs index 39975d37..109f7263 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -14,8 +14,6 @@ use iced_runtime::command::platform_specific::wayland::Action as WaylandAction; #[cfg(feature = "wayland")] use iced_runtime::command::platform_specific::Action as PlatformAction; use iced_runtime::command::Action; -#[cfg(not(feature = "wayland"))] -use iced_runtime::window::Action as WindowAction; use std::future::Future; /// Yields a command which contains a batch of commands. @@ -42,7 +40,7 @@ pub fn drag() -> Command { /// Initiates a window drag. #[cfg(not(feature = "wayland"))] pub fn drag() -> Command { - iced::Command::none() + iced_runtime::window::drag() } /// Fullscreens the window. @@ -54,7 +52,7 @@ pub fn fullscreen() -> Command { /// Fullscreens the window. #[cfg(not(feature = "wayland"))] pub fn fullscreen() -> Command { - iced::Command::single(Action::Window(WindowAction::ChangeMode(Mode::Fullscreen))) + iced_runtime::window::change_mode(Mode::Fullscreen) } /// Minimizes the window. @@ -66,7 +64,7 @@ pub fn minimize() -> Command { /// Minimizes the window. #[cfg(not(feature = "wayland"))] pub fn minimize() -> Command { - iced::Command::single(Action::Window(WindowAction::ChangeMode(Mode::Hidden))) + iced_runtime::window::minimize(true) } /// Sets the title of a window. @@ -94,7 +92,7 @@ pub fn set_windowed() -> Command { /// Sets the window mode to windowed. #[cfg(not(feature = "wayland"))] pub fn set_windowed() -> Command { - iced::Command::single(Action::Window(WindowAction::ChangeMode(Mode::Windowed))) + iced_runtime::window::change_mode(Mode::Windowed) } /// Toggles the windows' maximization state. @@ -106,7 +104,7 @@ pub fn toggle_fullscreen() -> Command { /// Toggles the windows' maximization state. #[cfg(not(feature = "wayland"))] pub fn toggle_fullscreen() -> Command { - iced::Command::single(Action::Window(WindowAction::ToggleMaximize)) + iced_runtime::window::toggle_maximize() } /// Creates a command to apply an action to a window.