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
This commit is contained in:
parent
c23a610d52
commit
3e2c517dd1
7 changed files with 27 additions and 16 deletions
|
@ -1,7 +1,11 @@
|
|||
use gpui::{AnyView, WindowContext};
|
||||
|
||||
/// A trait for elements that can be selected.
|
||||
pub trait Selectable {
|
||||
/// Sets whether the element is selected.
|
||||
fn selected(self, selected: bool) -> Self;
|
||||
|
||||
/// Sets the tooltip that should be shown when the element is selected.
|
||||
fn selected_tooltip(
|
||||
self,
|
||||
tooltip: Box<dyn Fn(&mut WindowContext) -> AnyView + 'static>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue