T07a navigation tabs and paths: tabs, editor tabs, tab overflow menu, breadcrumb, pagination, steps and wizard; shared slide, list trigger and tab stop
This commit is contained in:
50 files changed
+2490
-330
No files matched your search
+16
-2
@@ -1,6 +1,6 @@
|
||||
use gpui::{
|
||||
AnyElement, App, Div, Entity, FocusHandle, InteractiveElement, IntoElement, ParentElement,
|
||||
RenderOnce, StyleRefinement, Styled, Window, actions, div,
|
||||
AnyElement, App, Div, ElementId, Entity, FocusHandle, InteractiveElement, IntoElement,
|
||||
ParentElement, RenderOnce, StyleRefinement, Styled, Window, actions, div,
|
||||
};
|
||||
|
||||
use crate::theme::ActiveTheme;
|
||||
@@ -134,3 +134,17 @@ pub(crate) fn give_back(state: &Entity<Takeover>, window: &mut Window, cx: &App)
|
||||
None => log::info!("focus: overlay closed, nothing was focused before"),
|
||||
}
|
||||
}
|
||||
|
||||
/// A focus handle kept for `id`, a Tab stop while enabled.
|
||||
pub(crate) fn tab_stop(
|
||||
id: ElementId,
|
||||
enabled: bool,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) -> FocusHandle {
|
||||
window
|
||||
.use_keyed_state(id, cx, |_, cx| cx.focus_handle())
|
||||
.read(cx)
|
||||
.clone()
|
||||
.tab_stop(enabled)
|
||||
}
|
||||
@@ -11,7 +11,7 @@ mod tooltip;
|
||||
pub use backdrop::{Backdrop, Place};
|
||||
pub use divider::Divider;
|
||||
pub use focus::{FocusNext, FocusPrev, FocusRing, FocusScope};
|
||||
pub(crate) use focus::{give_back, take_focus};
|
||||
pub(crate) use focus::{give_back, tab_stop, take_focus};
|
||||
pub use ghost::DragGhost;
|
||||
pub use icon::{Icon, IconName};
|
||||
pub use image::Image;
|
||||
|
||||
Reference in new issue
Block a user