onboarding: Wire up tab index (#35659)
Closes #ISSUE Allows tabbing through everything in all three pages. Until #35075 is merged it is not possible to actually "click" tab focused buttons with the keyboard. Additionally adds an action `onboarding::Finish` and displays the keybind. The action corresponds to both the "Skip all" and "Start Building" buttons, with the keybind displayed similar to how it is for the page nav buttons Release Notes: - N/A *or* Added/Fixed/Improved ... --------- Co-authored-by: MrSubidubi <finn@zed.dev>
This commit is contained in:
@@ -4699,6 +4699,8 @@ pub enum ElementId {
|
||||
Path(Arc<std::path::Path>),
|
||||
/// A code location.
|
||||
CodeLocation(core::panic::Location<'static>),
|
||||
/// A labeled child of an element.
|
||||
NamedChild(Box<ElementId>, SharedString),
|
||||
}
|
||||
|
||||
impl ElementId {
|
||||
@@ -4719,6 +4721,7 @@ impl Display for ElementId {
|
||||
ElementId::Uuid(uuid) => write!(f, "{}", uuid)?,
|
||||
ElementId::Path(path) => write!(f, "{}", path.display())?,
|
||||
ElementId::CodeLocation(location) => write!(f, "{}", location)?,
|
||||
ElementId::NamedChild(id, name) => write!(f, "{}-{}", id, name)?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -4809,6 +4812,12 @@ impl From<(&'static str, u32)> for ElementId {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Into<SharedString>> From<(ElementId, T)> for ElementId {
|
||||
fn from((id, name): (ElementId, T)) -> Self {
|
||||
ElementId::NamedChild(Box::new(id), name.into())
|
||||
}
|
||||
}
|
||||
|
||||
/// A rectangle to be rendered in the window at the given position and size.
|
||||
/// Passed as an argument [`Window::paint_quad`].
|
||||
#[derive(Clone)]
|
||||
|
||||
Reference in New Issue
Block a user