Implement Selectable for buttons (#3451)
This PR implements the `Selectable` trait for `ButtonLike`, `Button`, and `IconButton`. Release Notes: - N/A
This commit is contained in:
@@ -1,15 +1,7 @@
|
||||
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>,
|
||||
) -> Self;
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq, Hash, Clone, Copy)]
|
||||
|
||||
Reference in New Issue
Block a user