ZIm/crates/ui2/src/clickable.rs
Marshall Bowers 3e2c517dd1
Add Disableable trait (#3439)
This PR adds a new `Disableable` trait to use for elements that are
capable of being disabled.

Release Notes:

- N/A
2023-11-29 13:01:26 -05:00

7 lines
281 B
Rust

use gpui::{ClickEvent, WindowContext};
/// A trait for elements that can be clicked.
pub trait Clickable {
/// Sets the click handler that will fire whenever the element is clicked.
fn on_click(self, handler: impl Fn(&ClickEvent, &mut WindowContext) + 'static) -> Self;
}