feat(segmented_button): add on_middle_press

This commit is contained in:
Jason Hansen 2024-07-01 18:53:45 -06:00 committed by GitHub
parent bfbff0773a
commit 41d1f4a7cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 16 deletions

View file

@ -101,6 +101,15 @@ impl<'a, Message: Clone + 'static> NavBar<'a, Message> {
self
}
/// Emitted when the middle mouse button is pressed on a button.
pub fn on_middle_press<T>(mut self, on_middle_press: T) -> Self
where
T: Fn(Id) -> Message + 'static,
{
self.segmented_button = self.segmented_button.on_middle_press(on_middle_press);
self
}
/// Handle the dnd drop event.
pub fn on_dnd_drop<D: AllowedMimeTypes>(
mut self,