Closed hcavarsan closed 2 months ago
The recent changes introduce a new feature that allows users to pin and unpin the application window, ensuring it stays on top when pinned. This involves adding an is_pinned
state to the application, updating window behavior based on this state, and providing a user interface element to toggle the pinned state.
Files/Modules | Change Summary |
---|---|
crates/kftray-tauri/src/main.rs |
Added is_pinned field to AppState , initialized it in main() , and added logic to handle pin state. |
crates/kftray-tauri/src/tray.rs |
Adjusted handle_window_event to control window behavior based on the pinned state. |
crates/kftray-tauri/src/window.rs |
Updated window visibility logic and added toggle_pin_state function to manage the pinned state. |
frontend/src/components/Header/index.tsx |
Added UI elements and logic to toggle pinning/unpinning the window through a new IconButton . |
sequenceDiagram
participant User
participant Header as Header Component
participant Window as Window Module
participant AppState as AppState
User->>Header: Clicks Pin/Unpin Button
Header->>Window: invoke('toggle_pin_state')
Window->>AppState: Toggle is_pinned State
AppState->>Window: Return Updated is_pinned State
Window->>Header: Update UI Based on is_pinned State
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
feat: add pin button to set always visible and focused