13 releases
0.4.5 | Aug 15, 2024 |
---|---|
0.4.4 | Jul 4, 2024 |
0.4.3 | Nov 16, 2023 |
0.4.0 | Jun 20, 2023 |
0.2.3 | Oct 31, 2021 |
#281 in GUI
6,069 downloads per month
Used in tauri-plugin-notification
33KB
525 lines
win7-notifications
Send Windows 10 styled notifications on Windows 7.
Note:
This crate requires a win32 event loop to be running on the thread, otherwise the notification will close immediately, check examples/single.rs which uses winit or just roll your own win32 event loop.
TODO:
- Move old notifications above new ones.
- Sounds
- Shadows
- Change close button color when mouse hovers.
- Callbacks for when close button or body of notification is clicked.
- Account for taskbar size and position
- Animations
lib.rs
:
Send Windows 10 styled notifications on Windows 7.
Note:
This crate requires a win32 event loop to be running on the thread, otherwise the notification will close immediately, it is recommended to use it with other win32 event loop crates like winit or just use your own win32 event loop.
Examples
Example 1: Simple Notification
Notification::new()
.appname("App name")
.summary("Critical Error")
.body("Just kidding, this is just the notification example.")
.icon(icon.to_vec(), 32, 32)
.timeout(Timeout::Default) // 5000 milliseconds
.show().unwrap();
Example 2: Presistent Notification
Notification::new()
.appname("App name")
.summary("Critical Error")
.body("Just kidding, this is just the notification example.")
.icon(icon.to_vec(), 32, 32)
.timeout(Timeout::Never)
.show().unwrap();
Dependencies
~10–18MB
~224K SLoC