Merge branch 'master' into feature/test-recorder

This commit is contained in:
Héctor Ramón Jiménez 2025-09-19 18:23:28 +02:00
commit e2df674aa5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
9 changed files with 26 additions and 25 deletions

4
Cargo.lock generated
View file

@ -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",

View file

@ -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 }

View file

@ -11,7 +11,7 @@ pub fn from_rgba(
) -> Result<Icon, Error> {
const PIXEL_SIZE: usize = mem::size_of::<u8>() * 4;
if rgba.len() % PIXEL_SIZE != 0 {
if !rgba.len().is_multiple_of(PIXEL_SIZE) {
return Err(Error::ByteCountNotDivisibleBy4 {
byte_count: rgba.len(),
});

View file

@ -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<I, F, T>(id: I, f: F) -> Subscription<T>
where
I: Hash + 'static,

View file

@ -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"
);

View file

@ -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)

View file

@ -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)
}
}

View file

@ -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((

View file

@ -201,23 +201,23 @@ where
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) {
let state = tree.state.downcast_mut::<State>();
if let Event::Mouse(_) = event {
let state = tree.state.downcast_mut::<State>();
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(