Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ homepage = "https://slint.dev"
keywords = ["gui", "toolkit", "graphics", "design", "ui"]
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
repository = "https://github.com/slint-ui/slint"
rust-version = "1.92"
rust-version = "1.95"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to make this change without bumping the MSRV. If we decide to bump it, it's an effort that also requires changing documentation and it's something we do usually very consciously.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I only changed it because I wrote the PR to use if let guards and I thought this would be a quick way to test this on CI since I was mostly busy on my drag-and-drop PR. It ended up breaking CI even more though

version = "1.17.0"

[workspace.dependencies]
Expand Down
2 changes: 2 additions & 0 deletions api/cpp/cbindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ fn gen_corelib(
"slint_image_to_rgb8",
"slint_image_to_rgba8",
"slint_image_to_rgba8_premultiplied",
"slint_image_from_shared_buffer_rgb8",
"slint_image_from_shared_buffer_rgba8",
"SharedPixelBuffer",
"SharedImageBuffer",
"StaticTextures",
Expand Down
33 changes: 17 additions & 16 deletions api/cpp/include/private/slint_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,27 @@ struct Image
}

/// Construct an image from a SharedPixelBuffer of RGB pixels.
Image(SharedPixelBuffer<Rgb8Pixel> buffer)
: data(Data::ImageInner_EmbeddedImage(
cbindgen_private::types::ImageCacheKey::Invalid(),
cbindgen_private::types::SharedImageBuffer::RGB8(
cbindgen_private::types::SharedPixelBuffer<Rgb8Pixel> {
.width = buffer.width(),
.height = buffer.height(),
.data = buffer.m_data })))
Image(SharedPixelBuffer<Rgb8Pixel> buffer) : data(Data::ImageInner_None())
{
cbindgen_private::types::SharedPixelBuffer<Rgb8Pixel> buffer_private {
.width = buffer.width(),
.height = buffer.height(),
.data = buffer.m_data,
};

cbindgen_private::types::slint_image_from_shared_buffer_rgb8(&buffer_private, &data);
}

/// Construct an image from a SharedPixelBuffer of RGBA pixels.
Image(SharedPixelBuffer<Rgba8Pixel> buffer)
: data(Data::ImageInner_EmbeddedImage(
cbindgen_private::types::ImageCacheKey::Invalid(),
cbindgen_private::types::SharedImageBuffer::RGBA8(
cbindgen_private::types::SharedPixelBuffer<Rgba8Pixel> {
.width = buffer.width(),
.height = buffer.height(),
.data = buffer.m_data })))
Image(SharedPixelBuffer<Rgba8Pixel> buffer) : data(Data::ImageInner_None())
{
cbindgen_private::types::SharedPixelBuffer<Rgba8Pixel> buffer_private {
.width = buffer.width(),
.height = buffer.height(),
.data = buffer.m_data,
};

cbindgen_private::types::slint_image_from_shared_buffer_rgba8(&buffer_private, &data);
}

/// Returns the size of the Image in pixels.
Expand Down Expand Up @@ -275,6 +275,7 @@ struct Image
private:
using Tag = cbindgen_private::types::ImageInner::Tag;
using Data = cbindgen_private::types::Image;

Data data;
};

Expand Down
6 changes: 6 additions & 0 deletions helper_crates/vtable/src/vrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ impl<VTable: VTableMetaDropInPlace + 'static, X> core::fmt::Debug for VRc<VTable
}
}

impl<VTable: VTableMetaDropInPlace, X: HasStaticVTable<VTable>> From<X> for VRc<VTable, X> {
fn from(value: X) -> Self {
Self::new(value)
}
}

impl<VTable: VTableMetaDropInPlace, X: HasStaticVTable<VTable>> VRc<VTable, X> {
/// Create a new VRc from an instance of a type that can be associated with a VTable.
///
Expand Down
9 changes: 4 additions & 5 deletions internal/backends/linuxkms/fullscreenwindowadapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::rc::Rc;

use i_slint_core::Property;
use i_slint_core::api::{LogicalPosition, PhysicalSize as PhysicalWindowSize};
use i_slint_core::graphics::{Image, euclid};
use i_slint_core::graphics::{EmbeddedImage, Image, euclid};
use i_slint_core::item_rendering::ItemRenderer;
use i_slint_core::lengths::LogicalRect;
use i_slint_core::platform::WindowEvent;
Expand Down Expand Up @@ -149,10 +149,9 @@ fn mouse_cursor_image() -> Image {
i_slint_core::ImageInner::Svg(svg) => {
let pixels = svg.render(None).unwrap();
let cache_key = svg.cache_key();
let mouse_pointer_pixel_image = i_slint_core::graphics::ImageInner::EmbeddedImage {
cache_key: cache_key.clone(),
buffer: pixels,
};
let mouse_pointer_pixel_image = i_slint_core::graphics::ImageInner::EmbeddedImage(
EmbeddedImage { cache_key: cache_key.clone(), buffer: pixels }.into(),
);
i_slint_core::graphics::cache::replace_cached_image(
cache_key,
mouse_pointer_pixel_image.clone(),
Expand Down
Loading
Loading