mirror of
https://github.com/danbulant/cushy
synced 2026-07-07 12:10:44 +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.
|
/// dismisses the message box.
|
||||||
/// - `FnMut()` implementors: A button with the default caption given its
|
/// - `FnMut()` implementors: A button with the default caption given its
|
||||||
/// context that invokes the closure when chosen.
|
/// 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,
|
/// To create a button with a custom caption that invokes a closure when chosen,
|
||||||
/// use [`MessageButton::custom`].
|
/// use [`MessageButton::custom`].
|
||||||
|
|
@ -99,6 +101,12 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<()> for MessageButton {
|
||||||
|
fn from(_value: ()) -> Self {
|
||||||
|
Self::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
struct OptionalCallback(Arc<Mutex<Option<OnceCallback>>>);
|
struct OptionalCallback(Arc<Mutex<Option<OnceCallback>>>);
|
||||||
|
|
||||||
|
|
@ -802,7 +810,7 @@ impl MakeWidget for FilePickerWidget {
|
||||||
cb.invoke(chosen_path.clone());
|
cb.invoke(chosen_path.clone());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.with_no(|| {})
|
.with_no(())
|
||||||
.finish()
|
.finish()
|
||||||
.open(&self.handle);
|
.open(&self.handle);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue