Skip to content

Comments

feat(pytauri)!: implement tauri tray feature#79

Merged
WSH032 merged 2 commits intomainfrom
feat/tray
Feb 16, 2025
Merged

feat(pytauri)!: implement tauri tray feature#79
WSH032 merged 2 commits intomainfrom
feat/tray

Conversation

@WSH032
Copy link
Member

@WSH032 WSH032 commented Feb 16, 2025

Summary

Added:

  • feat: implement tauri tray feature: enable tauri/tray-icon feature
    • mod tauri:: - Rect - Size - enum RunEvent::{MenuEvent, TrayIconEvent} - AppHandle::{run_on_main_thread, exit, restart, on_tray_icon_event, tray_by_id, remove_tray_by_id, default_window_icon, invoke_key}
    • mod tauri::tray
    • mod webview::
      • WebviewWindow::{run_on_main_thread, set_icon}

Changed:

  • bump rust-version = "1.82"
  • perf(pytauri): almost all of pyo3 pymethods will release the GIL now

Docs:

  • update example/nicegui-app to use tray and menu features
    • use python3.10 match statement instead of if-else statement
    • bump requires-python = ">=3.10"

Internal:

  • pytauri.ffi.ipc.JavaScriptChannelId.from_str becomes staticmethod from classmethod
  • refactor(pyo3-utils): use rust v1.82 feature Omitting empty types in pattern matching in place of Result<T, Infallible>::unwrap

BREAKING CHANGE:

  • perf(pytauri): the fields type of enum RunEvent struct variants changed to Py<T>

Checklist

  • I've read CONTRIBUTING.md.
  • I understand that this PR may be closed in case there was no previous discussion/issue. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation and/or CHANGELOG.md accordingly.

@WSH032 WSH032 mentioned this pull request Feb 11, 2025
7 tasks
@WSH032 WSH032 force-pushed the feat/tray branch 2 times, most recently from 3f24e5b to 93ee323 Compare February 16, 2025 05:01
Added:

- feat: implement tauri `tray` feature:
    enable `tauri/tray-icon` feature
    - `mod tauri::`
        - `Rect`
        - `Size`
        - `enum RunEvent::{MenuEvent, TrayIconEvent}`
        - `AppHandle::{run_on_main_thread, exit, restart,
          on_tray_icon_event, tray_by_id, remove_tray_by_id,
          default_window_icon, invoke_key}`
    - `mod tauri::tray`
    - `mod webview::`
        - `WebviewWindow::{run_on_main_thread, set_icon}`

Changed:

- bump `rust-version = "1.82"`
- perf(pytauri): almost all of pyo3 `pymethods` will release the `GIL`
  now

Docs:

- update `example/nicegui-app` to use `tray` and `menu` features
    - use `python3.10` `match` statement instead of `if-else` statement
    - bump `requires-python = ">=3.10"`

Internal:

- `pytauri.ffi.ipc.JavaScriptChannelId.from_str` becomes `staticmethod`
  from `classmethod`
- refactor(pyo3-utils): use `rust v1.82` feature `Omitting empty types
  in pattern matching` in place of `Result<T, Infallible>::unwrap`

BREAKING CHANGE:

- perf(pytauri): the fields type of `enum RunEvent` `struct` variants
  changed to `Py<T>`
For matrix jobs, we must set `python-version`, otherwise `uv` may
incorrectly use other Python versions cached in GitHub Actions.

Ref: <astral-sh/uv#9454>
@WSH032 WSH032 merged commit 92eeba1 into main Feb 16, 2025
12 checks passed
@WSH032 WSH032 deleted the feat/tray branch February 16, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant