event-actions: Add toast for copied messages

Part-of: <https://gitlab.gnome.org/GNOME/fractal/-/merge_requests/1146>
This commit is contained in:
Kirill Schmidt 2022-09-03 20:23:34 +02:00 committed by Marge Bot
parent e0d89e8da1
commit 76d2de4338

View file

@ -143,6 +143,7 @@ where
"copy-text",
clone!(@weak self as widget => move |_, _| {
widget.clipboard().set_text(&text_message.body);
toast!(widget, gettext("Message copied to clipboard"));
})
);
}
@ -173,6 +174,7 @@ where
let display_name = event.sender().display_name();
let message = display_name + " " + &message.body;
widget.clipboard().set_text(&message);
toast!(widget, gettext("Message copied to clipboard"));
})
);
}