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]] [[package]]
name = "dpi" name = "dpi"
version = "0.1.1" 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]] [[package]]
name = "drm" name = "drm"
@ -7672,7 +7672,7 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.30.8" 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 = [ dependencies = [
"ahash", "ahash",
"android-activity", "android-activity",

View file

@ -229,7 +229,7 @@ web-sys = "0.3.69"
web-time = "1.1" web-time = "1.1"
wgpu = "26.0" wgpu = "26.0"
window_clipboard = "0.4.1" 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] [workspace.lints.rust]
rust_2018_idioms = { level = "deny", priority = -1 } rust_2018_idioms = { level = "deny", priority = -1 }

View file

@ -11,7 +11,7 @@ pub fn from_rgba(
) -> Result<Icon, Error> { ) -> Result<Icon, Error> {
const PIXEL_SIZE: usize = mem::size_of::<u8>() * 4; 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 { return Err(Error::ByteCountNotDivisibleBy4 {
byte_count: rgba.len(), 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> pub fn filter_map<I, F, T>(id: I, f: F) -> Subscription<T>
where where
I: Hash + 'static, I: Hash + 'static,

View file

@ -795,7 +795,7 @@ impl graphics::mesh::Renderer for Renderer {
); );
debug_assert!( debug_assert!(
mesh.indices().len() % 3 == 0, mesh.indices().len().is_multiple_of(3),
"Mesh indices length must be a multiple of 3" "Mesh indices length must be a multiple of 3"
); );

View file

@ -1860,7 +1860,10 @@ where
row![ row![
svg(LOGO.clone()).width(text_size * 1.3), 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) .spacing(text_size.0 / 3.0)
.align_y(Alignment::Center) .align_y(Alignment::Center)

View file

@ -534,8 +534,7 @@ impl Focus {
self.is_window_focused self.is_window_focused
&& ((self.now - self.updated_at).as_millis() && ((self.now - self.updated_at).as_millis()
/ Self::CURSOR_BLINK_INTERVAL_MILLIS) / Self::CURSOR_BLINK_INTERVAL_MILLIS)
% 2 .is_multiple_of(2)
== 0
} }
} }

View file

@ -512,8 +512,7 @@ where
let is_cursor_visible = !is_disabled let is_cursor_visible = !is_disabled
&& ((focus.now - focus.updated_at).as_millis() && ((focus.now - focus.updated_at).as_millis()
/ CURSOR_BLINK_INTERVAL_MILLIS) / CURSOR_BLINK_INTERVAL_MILLIS)
% 2 .is_multiple_of(2);
== 0;
let cursor = if is_cursor_visible { let cursor = if is_cursor_visible {
Some(( Some((

View file

@ -201,23 +201,23 @@ where
shell: &mut Shell<'_, Message>, shell: &mut Shell<'_, Message>,
viewport: &Rectangle, 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; *state = cursor
let was_idle = *state == State::Idle; .position_over(layout.bounds())
.map(|cursor_position| State::Hovered { cursor_position })
.unwrap_or_default();
*state = cursor let is_idle = *state == State::Idle;
.position_over(layout.bounds())
.map(|cursor_position| State::Hovered { cursor_position })
.unwrap_or_default();
let is_idle = *state == State::Idle; if was_idle != is_idle {
shell.invalidate_layout();
if was_idle != is_idle shell.request_redraw();
|| (self.position == Position::FollowCursor } else if self.position == Position::FollowCursor {
&& previous_state != *state) shell.request_redraw();
{ }
shell.request_redraw();
} }
self.content.as_widget_mut().update( self.content.as_widget_mut().update(