diff --git a/examples/svg/Cargo.toml b/examples/svg/Cargo.toml index 78208fb0b0..d5b95d0178 100644 --- a/examples/svg/Cargo.toml +++ b/examples/svg/Cargo.toml @@ -7,4 +7,4 @@ publish = false [dependencies] iced.workspace = true -iced.features = ["svg"] +iced.features = ["svg", "winit"] diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index 4c9b5ab99e..42589b0940 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -1,7 +1,6 @@ use iced::alignment::{self, Alignment}; use iced::font::{self, Font}; -use iced::keyboard::{self, KeyCode, Modifiers}; -use iced::subscription; +use iced::keyboard; use iced::theme::{self, Theme}; use iced::widget::{ self, button, checkbox, column, container, keyed_column, row, scrollable, diff --git a/sctk/src/application.rs b/sctk/src/application.rs index 101ecf22b5..910a5a801b 100644 --- a/sctk/src/application.rs +++ b/sctk/src/application.rs @@ -29,7 +29,7 @@ use iced_futures::{ renderer::Style, time::Instant, widget::{ - operation::{self, focusable::focus, OperationWrapper}, + operation::{self, OperationWrapper}, tree, Operation, Tree, }, Widget, @@ -48,7 +48,7 @@ use std::{ use wayland_backend::client::ObjectId; use wayland_protocols::wp::viewporter::client::wp_viewport::WpViewport; -use iced_graphics::{compositor, renderer, Compositor, Viewport}; +use iced_graphics::{compositor, Compositor, Viewport}; use iced_runtime::{ clipboard, command::{ @@ -822,7 +822,7 @@ where // Dnd Surfaces are only drawn once let id = wl_surface.id(); - let (native_id, e, node) = match dnd_icon { + let (native_id, _e, node) = match dnd_icon { DndIcon::Custom(id) => { let mut e = application.view(id); let state = e.as_widget().state(); @@ -1428,12 +1428,14 @@ where }); } Action::Focus => { - commands.push(Command::widget(focus( - iced_runtime::core::id::Id::from(u128::from( - request.target.0, - ) - as u64), - ))); + commands.push(Command::widget( + operation::focusable::focus( + iced_runtime::core::id::Id::from(u128::from( + request.target.0, + ) + as u64), + ), + )); } Action::Blur => todo!(), Action::Collapse => todo!(), @@ -1666,10 +1668,6 @@ where self.frame = frame; } - pub(crate) fn frame(&self) -> Option<&WlSurface> { - self.frame.as_ref() - } - pub(crate) fn first(&self) -> bool { self.first } diff --git a/sctk/src/conversion.rs b/sctk/src/conversion.rs index 7d50287d82..44e75de443 100644 --- a/sctk/src/conversion.rs +++ b/sctk/src/conversion.rs @@ -18,7 +18,7 @@ use sctk::{ use xkeysym::{key, RawKeysym}; lazy_static::lazy_static! { - pub static ref key_conversion: HashMap = [ + pub static ref KEY_CONVERSION: HashMap = [ (key::_1, KeyCode::Key1), (key::_2, KeyCode::Key2), (key::_3, KeyCode::Key3), (key::_4, KeyCode::Key4), (key::_5, KeyCode::Key5), (key::_6, KeyCode::Key6), (key::_7, KeyCode::Key7), (key::_8, KeyCode::Key8), (key::_9, KeyCode::Key9), (key::_0, KeyCode::Key0), // Letters. (key::A, KeyCode::A), (key::a, KeyCode::A), (key::B, KeyCode::B), (key::b, KeyCode::B), (key::C, KeyCode::C), (key::c, KeyCode::C), (key::D, KeyCode::D), (key::d, KeyCode::D), (key::E, KeyCode::E), (key::e, KeyCode::E), (key::F, KeyCode::F), (key::f, KeyCode::F), (key::G, KeyCode::G), (key::g, KeyCode::G), (key::H, KeyCode::H), (key::h, KeyCode::H), (key::I, KeyCode::I), (key::i, KeyCode::I), (key::J, KeyCode::J), (key::j, KeyCode::J), (key::K, KeyCode::K), (key::k, KeyCode::K), (key::L, KeyCode::L), (key::l, KeyCode::L), (key::M, KeyCode::M), (key::m, KeyCode::M), (key::N, KeyCode::N), (key::n, KeyCode::N), (key::O, KeyCode::O), (key::o, KeyCode::O), (key::P, KeyCode::P), (key::p, KeyCode::P), (key::Q, KeyCode::Q), (key::q, KeyCode::Q), (key::R, KeyCode::R), (key::r, KeyCode::R), (key::S, KeyCode::S), (key::s, KeyCode::S), (key::T, KeyCode::T), (key::t, KeyCode::T), (key::U, KeyCode::U), (key::u, KeyCode::U), (key::V, KeyCode::V), (key::v, KeyCode::V), (key::W, KeyCode::W), (key::w, KeyCode::W), (key::X, KeyCode::X), (key::x, KeyCode::X), (key::Y, KeyCode::Y), (key::y, KeyCode::Y), (key::Z, KeyCode::Z), (key::z, KeyCode::Z), @@ -156,7 +156,7 @@ pub fn modifiers_to_native(mods: Modifiers) -> keyboard::Modifiers { } pub fn keysym_to_vkey(keysym: RawKeysym) -> Option { - key_conversion.get(&keysym).cloned() + KEY_CONVERSION.get(&keysym).cloned() } pub(crate) fn cursor_icon(cursor: Interaction) -> CursorIcon { diff --git a/sctk/src/event_loop/mod.rs b/sctk/src/event_loop/mod.rs index 46f33cd702..8e2acd1dd3 100644 --- a/sctk/src/event_loop/mod.rs +++ b/sctk/src/event_loop/mod.rs @@ -244,11 +244,11 @@ where surface: &WlSurface, app_id: Option, surface_title: Option, - role: iced_accessibility::accesskit::Role, + _role: iced_accessibility::accesskit::Role, ) -> adapter::IcedSctkAdapter { use iced_accessibility::{ accesskit::{ - Node, NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate, + NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate, }, accesskit_unix::Adapter, window_node_id, diff --git a/src/wayland/mod.rs b/src/wayland/mod.rs index b768f49648..8132552fbd 100644 --- a/src/wayland/mod.rs +++ b/src/wayland/mod.rs @@ -1,5 +1,5 @@ use crate::runtime::window::Id; -use crate::{Command, Element, Executor, Settings, Subscription}; +use crate::{Command, Element, Executor, Settings as Settings_, Subscription}; /// wayland sandbox pub mod sandbox; @@ -119,7 +119,7 @@ pub trait Application: Sized { /// [`Error`] during startup. /// /// [`Error`]: crate::Error - fn run(settings: Settings) -> crate::Result + fn run(settings: Settings_) -> crate::Result where Self: 'static, { diff --git a/widget/src/lib.rs b/widget/src/lib.rs index 022a7e195f..47fd1888d4 100644 --- a/widget/src/lib.rs +++ b/widget/src/lib.rs @@ -133,10 +133,8 @@ pub mod qr_code; pub use qr_code::QRCode; #[cfg(feature = "wayland")] -#[doc(no_inline)] pub mod dnd_listener; #[cfg(feature = "wayland")] -#[doc(no_inline)] pub mod dnd_source; type Renderer = renderer::Renderer;