Remove ViewContext::dispatch_action

This commit is contained in:
Antonio Scandurra
2023-05-01 16:27:36 +02:00
parent d815fc88ae
commit c4472b0786
41 changed files with 574 additions and 670 deletions
+1 -18
View File
@@ -156,24 +156,7 @@ pub fn keystroke_label<V: View>(
pub type ButtonStyle = Interactive<ContainedText>;
pub fn cta_button<L, A, V>(
label: L,
action: A,
max_width: f32,
style: &ButtonStyle,
cx: &mut ViewContext<V>,
) -> MouseEventHandler<A, V>
where
L: Into<Cow<'static, str>>,
A: 'static + Action + Clone,
V: View,
{
cta_button_with_click::<A, _, _, _>(label, max_width, style, cx, move |_, _, cx| {
cx.dispatch_action(action.clone())
})
}
pub fn cta_button_with_click<Tag, L, V, F>(
pub fn cta_button<Tag, L, V, F>(
label: L,
max_width: f32,
style: &ButtonStyle,