mirror of
https://github.com/danbulant/cushy
synced 2026-06-20 15:01:11 +00:00
() -> MessageButton
This commit is contained in:
parent
43a24501f9
commit
77f1bd46f7
1 changed files with 9 additions and 1 deletions
|
|
@ -44,6 +44,8 @@ enum MessageButtonsKind {
|
|||
/// dismisses the message box.
|
||||
/// - `FnMut()` implementors: A button with the default caption given its
|
||||
/// context that invokes the closure when chosen.
|
||||
/// - `()`: The default button for this context. Equivalent to
|
||||
/// `MessageButton::default()`.
|
||||
///
|
||||
/// To create a button with a custom caption that invokes a closure when chosen,
|
||||
/// use [`MessageButton::custom`].
|
||||
|
|
@ -99,6 +101,12 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl From<()> for MessageButton {
|
||||
fn from(_value: ()) -> Self {
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
struct OptionalCallback(Arc<Mutex<Option<OnceCallback>>>);
|
||||
|
||||
|
|
@ -802,7 +810,7 @@ impl MakeWidget for FilePickerWidget {
|
|||
cb.invoke(chosen_path.clone());
|
||||
}
|
||||
})
|
||||
.with_no(|| {})
|
||||
.with_no(())
|
||||
.finish()
|
||||
.open(&self.handle);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue