mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
Merge pull request #531 from rowr111/main
documentation for modals.show_notification
This commit is contained in:
commit
bed33393ff
2 changed files with 27 additions and 1 deletions
BIN
docs/images/modals_show_notification.png
Normal file
BIN
docs/images/modals_show_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
|
|
@ -196,7 +196,33 @@ impl Modals {
|
|||
}
|
||||
}
|
||||
|
||||
/// this blocks until the notification has been acknowledged.
|
||||
/// Text/QR code notification modal dialog.
|
||||
///
|
||||
/// - `qrtext` turns submitted text into a qr code.
|
||||
/// - This dialog blocks until the notification has been acknowledged via [ Press any key ].
|
||||
/// - Dialog does not scroll, burden is on the consumer to make sure text + qr code do not overflow
|
||||
/// available space.
|
||||
///
|
||||
/// <details>
|
||||
/// <summary>Example Image</summary>
|
||||
///
|
||||
/// 
|
||||
///
|
||||
/// </details>
|
||||
///
|
||||
/// # Examples
|
||||
/// ```
|
||||
/// use modals::Modals;
|
||||
/// use xous_names::XousNames;
|
||||
/// let xns = XousNames::new().unwrap();
|
||||
/// let modals = Modals::new(&xns).unwrap();
|
||||
/// modals
|
||||
/// .show_notification(
|
||||
/// "Check the wiki:",
|
||||
/// Some("https://github.com/betrusted-io/betrusted-wiki/wiki"),
|
||||
/// )
|
||||
/// .unwrap();
|
||||
/// ```
|
||||
pub fn show_notification(&self, notification: &str, qrtext: Option<&str>) -> Result<(), xous::Error> {
|
||||
self.lock();
|
||||
let qrtext = match qrtext {
|
||||
|
|
|
|||
Loading…
Reference in a new issue