Toggle & Switch (#21979)
 - Adds the Switch component - Updates `Selected`, `Selectable` -> `ToggleState`, `Toggleable` - Adds `checkbox` and `switch` functions to align better with other elements in our layout system. We decided not to merge Switch and Checkbox. However, in a followup I'll introduce a Toggle or AnyToggle enum so we can update `CheckboxWithLabel` -> `ToggleWithLabel` as this component will work exactly the same with either a Checkbox or a Switch. Release Notes: - N/A
This commit is contained in:
@@ -73,8 +73,8 @@ impl ListHeader {
|
||||
}
|
||||
}
|
||||
|
||||
impl Selectable for ListHeader {
|
||||
fn selected(mut self, selected: bool) -> Self {
|
||||
impl Toggleable for ListHeader {
|
||||
fn toggle_state(mut self, selected: bool) -> Self {
|
||||
self.selected = selected;
|
||||
self
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ impl Disableable for ListItem {
|
||||
}
|
||||
}
|
||||
|
||||
impl Selectable for ListItem {
|
||||
fn selected(mut self, selected: bool) -> Self {
|
||||
impl Toggleable for ListItem {
|
||||
fn toggle_state(mut self, selected: bool) -> Self {
|
||||
self.selected = selected;
|
||||
self
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ impl ListSubHeader {
|
||||
}
|
||||
}
|
||||
|
||||
impl Selectable for ListSubHeader {
|
||||
fn selected(mut self, selected: bool) -> Self {
|
||||
impl Toggleable for ListSubHeader {
|
||||
fn toggle_state(mut self, selected: bool) -> Self {
|
||||
self.selected = selected;
|
||||
self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user