use gpui::{AlignSelf, SharedString, Styled};
#[derive(Clone, Copy)]
pub(crate) enum Role {
Button,
CheckBox,
ComboBox,
Dialog,
Label,
Menu,
MenuItem,
RadioButton,
Switch,
TextInput,
Tooltip,
}
#[derive(Clone, Copy)]
pub(crate) enum Toggled {
False,
True,
Mixed,
}
pub(crate) trait AccessibilityExt: Sized {
fn role(self, _role: Role) -> Self {
self
}
fn aria_label(self, _label: impl Into<SharedString>) -> Self {
self
}
fn aria_placeholder(self, _placeholder: impl Into<SharedString>) -> Self {
self
}
fn aria_expanded(self, _expanded: bool) -> Self {
self
}
fn aria_selected(self, _selected: bool) -> Self {
self
}
fn aria_toggled(self, _toggled: Toggled) -> Self {
self
}
}
impl<T> AccessibilityExt for T {}
pub(crate) trait StyleCompatExt: Styled + Sized {
fn self_start(mut self) -> Self {
self.style().align_self = Some(AlignSelf::FlexStart);
self
}
}
impl<T: Styled> StyleCompatExt for T {}