From 948772a657eb3caf20843628abac9109e3b67d41 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Tue, 24 Sep 2024 08:18:52 -0300 Subject: [PATCH] refactor(api): change `button_state` to camelCase (#11114) --- .changes/button-state-camel-case.md | 6 ++++++ crates/tauri/src/tray/mod.rs | 1 + packages/api/src/tray.ts | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/button-state-camel-case.md diff --git a/.changes/button-state-camel-case.md b/.changes/button-state-camel-case.md new file mode 100644 index 000000000000..7d70dc0239e4 --- /dev/null +++ b/.changes/button-state-camel-case.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/api": patch:breaking +"tauri": patch:bug +--- + +Change the `button_state` tray event field to camelCase `buttonState`. diff --git a/crates/tauri/src/tray/mod.rs b/crates/tauri/src/tray/mod.rs index 53d1589078b7..60756b5eeb6c 100644 --- a/crates/tauri/src/tray/mod.rs +++ b/crates/tauri/src/tray/mod.rs @@ -79,6 +79,7 @@ impl From for MouseButton { #[non_exhaustive] pub enum TrayIconEvent { /// A click happened on the tray icon. + #[serde(rename_all = "camelCase")] Click { /// Id of the tray icon which triggered this event. id: TrayIconId, diff --git a/packages/api/src/tray.ts b/packages/api/src/tray.ts index caf508cd34b0..8bc6864feec3 100644 --- a/packages/api/src/tray.ts +++ b/packages/api/src/tray.ts @@ -26,7 +26,7 @@ export interface TrayIconClickEvent { /** Mouse button that triggered this event. */ button: MouseButton /** Mouse button state when this event was triggered. */ - button_state: MouseButtonState + buttonState: MouseButtonState } /** A double click happened on the tray icon. **Windows Only** */