Skip to content

Commit da9c9a8

Browse files
committed
chore(docs): add .into()
1 parent 3a80c63 commit da9c9a8

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

docs/examples.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Located in `/examples/*/` - These are full Tauri applications you can run:
2323
- [`fullscreen/`](/examples/fullscreen/) - Panel behavior with fullscreen windows
2424
- [`mouse_tracking/`](/examples/mouse_tracking/) - Mouse tracking events
2525
- [`hover_activate/`](/examples/hover_activate/) - Auto-activate on hover
26+
- [`spotlight-app`](https://github.com/ahkohd/tauri-macos-spotlight-example) - An example macOS Spotlight app built with Tauri
27+
- [`menubar-app`](https://github.com/ahkohd/tauri-macos-menubar-app-example) - An example macOS Menubar app built with Tauri
2628

2729
## Running examples
2830

docs/key-types.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ Predefined window levels for panels. Higher levels appear above lower levels.
99
```rust
1010
use tauri_nspanel::PanelLevel;
1111

12-
panel.set_level(PanelLevel::Normal); // Standard window level
13-
panel.set_level(PanelLevel::Floating); // Floating above normal windows
14-
panel.set_level(PanelLevel::ModalPanel); // Modal panel level
15-
panel.set_level(PanelLevel::Utility); // Utility window level
16-
panel.set_level(PanelLevel::Status); // Status/menu bar level
17-
panel.set_level(PanelLevel::PopUpMenu); // Pop-up menu level
18-
panel.set_level(PanelLevel::ScreenSaver); // Screen saver level
19-
panel.set_level(PanelLevel::Custom(25)); // Custom level value
12+
// Available levels:
13+
// PanelLevel::Normal - Standard window level
14+
// PanelLevel::Floating - Floating above normal windows
15+
// PanelLevel::ModalPanel - Modal panel level
16+
// PanelLevel::Utility - Utility window level
17+
// PanelLevel::Status - Status/menu bar level
18+
// PanelLevel::PopUpMenu - Pop-up menu level
19+
// PanelLevel::ScreenSaver - Screen saver level
20+
panel.set_level(PanelLevel::Floating.value());
21+
22+
// Custom level value
23+
panel.set_level(PanelLevel::Custom(25).value());
2024
```
2125

2226
### Level Hierarchy (Lowest to Highest)
@@ -41,7 +45,7 @@ let behavior = CollectionBehavior::new()
4145
.stationary() // Don't move between Spaces
4246
.ignores_cycle(); // Skip in Cmd+Tab cycling
4347

44-
panel.set_collection_behavior(behavior);
48+
panel.set_collection_behavior(behavior.value());
4549
```
4650

4751
### Available Behaviors
@@ -125,7 +129,7 @@ let style = StyleMask::empty()
125129
.utility_window()
126130
.nonactivating_panel();
127131

128-
panel.set_style_mask(style);
132+
panel.set_style_mask(style.into());
129133
```
130134

131135
### Basic Styles
@@ -269,19 +273,19 @@ TrackingAreaOptions::new()
269273
All builder types implement `Into` traits for seamless conversion:
270274

271275
```rust
272-
// These are equivalent
273-
panel.set_level(PanelLevel::Floating);
274-
panel.set_level(PanelLevel::Floating.into());
275-
panel.set_level(3i32); // Raw NSWindowLevel value
276+
// These are all equivalent
277+
panel.set_level(PanelLevel::Floating.value());
278+
panel.set_level(3i64); // Raw NSWindowLevel value
279+
panel.set_level(3i32); // Also works via Into
276280

277-
// These are equivalent
281+
// These are equivalent
278282
let style = StyleMask::empty().titled();
279-
panel.set_style_mask(style);
280-
panel.set_style_mask(style.into());
283+
panel.set_style_mask(style.value());
284+
panel.set_collection_behavior(CollectionBehavior::new().can_join_all_spaces().value());
281285
```
282286

283287
## Next Steps
284288

285289
- [Learn about Panel Methods](panel-methods.md)
286290
- [Explore Event Handling](event-handling.md)
287-
- [Check out Complete Examples](examples.md)
291+
- [Check out Complete Examples](examples.md)

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ These examples demonstrate various features and use cases of [tauri-nspanel](htt
99
- [fullscreen](./fullscreen/): Panel that displays over fullscreen windows
1010
- [mouse_tracking](./mouse_tracking/): Mouse tracking events with enter/exit/move callbacks
1111
- [hover_activate](./hover_activate/): Auto-activate panel on mouse hover
12+
- [`spotlight-app`](https://github.com/ahkohd/tauri-macos-spotlight-example) - An example macOS Spotlight app built with Tauri
13+
- [`menubar-app`](https://github.com/ahkohd/tauri-macos-menubar-app-example) - An example macOS Menubar app built with Tauri
1214

1315
## Standalone Rust Examples
1416

0 commit comments

Comments
 (0)