Crates.io | tauri-winrt-notification |
lib.rs | tauri-winrt-notification |
version | 0.7.0 |
source | src |
created_at | 2022-08-29 13:25:41.230743 |
updated_at | 2024-10-29 14:23:36.856309 |
description | An incomplete wrapper over the WinRT toast api |
homepage | |
repository | https://github.com/tauri-apps/winrt-notification |
max_upload_size | |
id | 654488 |
size | 100,572 |
An incomplete wrapper over the WinRT toast api
Tested in Windows 10 and 8.1. Untested in Windows 8, might work.
Todo:
Known Issues:
Limitations:
#Cargo.toml
[dependencies]
tauri-winrt-notification = "0.5.1"
extern crate winrt_notification;
use tauri_winrt_notification::{Duration, Sound, Toast};
fn main() {
Toast::new(Toast::POWERSHELL_APP_ID)
.title("Look at this flip!")
.text1("(╯°□°)╯︵ ┻━┻")
.sound(Some(Sound::SMS))
.duration(Duration::Short)
.show()
.expect("unable to toast");
}
extern crate winrt_notification;
use std::path::Path;
use tauri_winrt_notification::{IconCrop, Toast};
fn main() {
Toast::new("Your AppUserModeId")
.hero(&Path::new("C:\\absolute\\path\\to\\image.jpeg"), "alt text")
.icon(
&Path::new("c:/this/style/works/too/image.png"),
IconCrop::Circular,
"alt text",
)
.title("Lots of pictures here")
.text1("One above the text as the hero")
.text2("One to the left as an icon, and several below")
.image(&Path::new("c:/photos/sun.png"), "the sun")
.image(&Path::new("c:/photos/moon.png"), "the moon")
.sound(None) // will be silent
.show()
.expect("unable to toast");
}