diff options
author | 2024-02-06 00:05:08 +0100 | |
---|---|---|
committer | 2024-02-06 00:05:08 +0100 | |
commit | b5b267c31c59d4b80629f8c4ec38d395f8d99eae (patch) | |
tree | 13aceb0c1b895f33e309369e69234a7e1638de31 | |
parent | 8e76d53803631ed581c6214f9c3abe02424c8272 (diff) | |
parent | f2e904f348797411c085a39a3ddf0605056a0ba2 (diff) | |
download | iced-b5b267c31c59d4b80629f8c4ec38d395f8d99eae.tar.gz iced-b5b267c31c59d4b80629f8c4ec38d395f8d99eae.tar.bz2 iced-b5b267c31c59d4b80629f8c4ec38d395f8d99eae.zip |
Merge pull request #2235 from fogarecious/add-from-pathbuf-to-svg-handle
Make the svg function to accept a path
Diffstat (limited to '')
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | core/src/svg.rs | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d16cece..05d5ebb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Custom` variant to `command::Action`. [#2146](https://github.com/iced-rs/iced/pull/2146) - Mouse movement events for `MouseArea`. [#2147](https://github.com/iced-rs/iced/pull/2147) - Dracula, Nord, Solarized, and Gruvbox variants for `Theme`. [#2170](https://github.com/iced-rs/iced/pull/2170) +- `From<T> where T: Into<PathBuf>` for `svg::Handle`. [#2235](https://github.com/iced-rs/iced/pull/2235) ### Changed - Enable WebGPU backend in `wgpu` by default instead of WebGL. [#2068](https://github.com/iced-rs/iced/pull/2068) @@ -108,6 +109,7 @@ Many thanks to... - @Decodetalkers - @derezzedex - @dtzxporter +- @fogarecious - @GyulyVGC - @hicaru - @ids1024 diff --git a/core/src/svg.rs b/core/src/svg.rs index 54e9434e..d63e3c95 100644 --- a/core/src/svg.rs +++ b/core/src/svg.rs @@ -50,6 +50,15 @@ impl Handle { } } +impl<T> From<T> for Handle +where + T: Into<PathBuf>, +{ + fn from(path: T) -> Handle { + Handle::from_path(path.into()) + } +} + impl Hash for Handle { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { self.id.hash(state); |