diff --git a/Cargo.lock b/Cargo.lock index efea5828..24fcb729 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1321,7 +1321,7 @@ dependencies = [ [[package]] name = "dpi" version = "0.1.1" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" [[package]] name = "drm" @@ -7672,7 +7672,7 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winit" version = "0.30.8" -source = "git+https://github.com/iced-rs/winit.git?rev=11414b6aa45699f038114e61b4ddf5102b2d3b4b#11414b6aa45699f038114e61b4ddf5102b2d3b4b" +source = "git+https://github.com/iced-rs/winit.git?rev=05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed#05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index 637edf1f..03b2e721 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -229,7 +229,7 @@ web-sys = "0.3.69" web-time = "1.1" wgpu = "26.0" window_clipboard = "0.4.1" -winit = { git = "https://github.com/iced-rs/winit.git", rev = "11414b6aa45699f038114e61b4ddf5102b2d3b4b" } +winit = { git = "https://github.com/iced-rs/winit.git", rev = "05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed" } [workspace.lints.rust] rust_2018_idioms = { level = "deny", priority = -1 } diff --git a/core/src/window/icon.rs b/core/src/window/icon.rs index fb34ca32..fe4a7083 100644 --- a/core/src/window/icon.rs +++ b/core/src/window/icon.rs @@ -11,7 +11,7 @@ pub fn from_rgba( ) -> Result { const PIXEL_SIZE: usize = mem::size_of::() * 4; - if rgba.len() % PIXEL_SIZE != 0 { + if !rgba.len().is_multiple_of(PIXEL_SIZE) { return Err(Error::ByteCountNotDivisibleBy4 { byte_count: rgba.len(), }); diff --git a/futures/src/subscription.rs b/futures/src/subscription.rs index 338b2622..2afaaae9 100644 --- a/futures/src/subscription.rs +++ b/futures/src/subscription.rs @@ -426,7 +426,7 @@ where } } -/// Creatges a [`Subscription`] from a hashable id and a filter function. +/// Creates a [`Subscription`] from a hashable id and a filter function. pub fn filter_map(id: I, f: F) -> Subscription where I: Hash + 'static, diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index c1977fb4..97a3216b 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -795,7 +795,7 @@ impl graphics::mesh::Renderer for Renderer { ); debug_assert!( - mesh.indices().len() % 3 == 0, + mesh.indices().len().is_multiple_of(3), "Mesh indices length must be a multiple of 3" ); diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 2d696c84..a30e8b97 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -1860,7 +1860,10 @@ where row![ svg(LOGO.clone()).width(text_size * 1.3), - text("iced").size(text_size).font(Font::MONOSPACE) + text("iced") + .size(text_size) + .font(Font::MONOSPACE) + .shaping(text::Shaping::Advanced) ] .spacing(text_size.0 / 3.0) .align_y(Alignment::Center) diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index a8e2676b..ef3a1429 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -534,8 +534,7 @@ impl Focus { self.is_window_focused && ((self.now - self.updated_at).as_millis() / Self::CURSOR_BLINK_INTERVAL_MILLIS) - % 2 - == 0 + .is_multiple_of(2) } } diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index 432ff9a5..0783f7c2 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -512,8 +512,7 @@ where let is_cursor_visible = !is_disabled && ((focus.now - focus.updated_at).as_millis() / CURSOR_BLINK_INTERVAL_MILLIS) - % 2 - == 0; + .is_multiple_of(2); let cursor = if is_cursor_visible { Some(( diff --git a/widget/src/tooltip.rs b/widget/src/tooltip.rs index 9333e1e1..866f58d0 100644 --- a/widget/src/tooltip.rs +++ b/widget/src/tooltip.rs @@ -201,23 +201,23 @@ where shell: &mut Shell<'_, Message>, viewport: &Rectangle, ) { - let state = tree.state.downcast_mut::(); + if let Event::Mouse(_) = event { + let state = tree.state.downcast_mut::(); + let was_idle = *state == State::Idle; - let previous_state = *state; - let was_idle = *state == State::Idle; + *state = cursor + .position_over(layout.bounds()) + .map(|cursor_position| State::Hovered { cursor_position }) + .unwrap_or_default(); - *state = cursor - .position_over(layout.bounds()) - .map(|cursor_position| State::Hovered { cursor_position }) - .unwrap_or_default(); + let is_idle = *state == State::Idle; - let is_idle = *state == State::Idle; - - if was_idle != is_idle - || (self.position == Position::FollowCursor - && previous_state != *state) - { - shell.request_redraw(); + if was_idle != is_idle { + shell.invalidate_layout(); + shell.request_redraw(); + } else if self.position == Position::FollowCursor { + shell.request_redraw(); + } } self.content.as_widget_mut().update(