Implement event capturing for Column
This commit is contained in:
parent
04468a7147
commit
3bcee62beb
2 changed files with 29 additions and 8 deletions
|
|
@ -35,3 +35,24 @@ pub enum Status {
|
|||
/// [`Event`]: enum.Event.html
|
||||
Captured,
|
||||
}
|
||||
|
||||
impl Status {
|
||||
/// Merges two [`Status`] into one.
|
||||
///
|
||||
/// `Captured` takes precedence over `Ignored`:
|
||||
///
|
||||
/// ```
|
||||
/// use iced_native::event::Status;
|
||||
///
|
||||
/// assert_eq!(Status::Ignored.merge(Status::Ignored), Status::Ignored);
|
||||
/// assert_eq!(Status::Ignored.merge(Status::Captured), Status::Captured);
|
||||
/// assert_eq!(Status::Captured.merge(Status::Ignored), Status::Captured);
|
||||
/// assert_eq!(Status::Captured.merge(Status::Captured), Status::Captured);
|
||||
/// ```
|
||||
pub fn merge(self, b: Self) -> Self {
|
||||
match self {
|
||||
Status::Ignored => b,
|
||||
Status::Captured => Status::Captured,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue