Skip to content

Commit

Permalink
refactor!(core): remove Icon enum and add Image type (#9011)
Browse files Browse the repository at this point in the history
* refactor!(core): remove `Icon` enum and add `Image` type

* clippy

* revert api example config change

* Update image.rs

* fix build

* clippy

* change files

* add back removed methods as setter functions

* simplify error message

* Update .changes/runtime-icon-lifetime.md

* Update .changes/ico-featrue-flags.md

* Update core/tauri/src/image.rs

* update api lockfile

* update api ref

* lint

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
  • Loading branch information
amrbashir and lucasfernog authored Feb 29, 2024
1 parent ab060eb commit d1e77ac
Show file tree
Hide file tree
Showing 36 changed files with 669 additions and 540 deletions.
5 changes: 5 additions & 0 deletions .changes/ico-featrue-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'major:breaking'
---

Renamed `icon-ico` and `icon-png` feature flags to `image-ico` and `image-png` respectively
5 changes: 5 additions & 0 deletions .changes/runtime-icon-lifetime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-runtime': 'major:breaking'
---

Add a lifetime parameter for `Icon` type. Also changed `rgba` field to be `Cow<'a, [u8]>`
5 changes: 5 additions & 0 deletions .changes/tauri-context-icon-methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'major:breaking'
---

Removed `Context::default_window_icon_mut` and `Context::tray_icon_mut`, use `Context::set_default_window_icon` and `Context::set_tray_icon` instead. Also changed `Context::set_tray_icon` to accept `Option<T>`.
5 changes: 5 additions & 0 deletions .changes/tauri-icon-removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'major:breaking'
---

Removed `Icon` enum, use the new `Image` type instead. All APIs that previously accepted `Icon` have changed to accept `Image` instead.
5 changes: 5 additions & 0 deletions .changes/tauri-image-codegen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri-codegen': 'major:breaking'
---

Change the generated context code to use the new `Image` type in tauri.
5 changes: 5 additions & 0 deletions .changes/tauri-image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'tauri': 'minor:feat'
---

Add `Image` type.
Loading

0 comments on commit d1e77ac

Please sign in to comment.