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
@@ -4,29 +4,13 @@ use ely_gpui_component::{
|
||||
},
|
||||
primitives::IconName,
|
||||
};
|
||||
use gpui::{App, Entity, IntoElement, ParentElement, SharedString, Styled, Window, div, px};
|
||||
use gpui::{App, IntoElement, ParentElement, SharedString, Styled, Window, div, px};
|
||||
|
||||
use crate::{
|
||||
probe::probe,
|
||||
ui::{code, section, specimen},
|
||||
ui::{code, keep, section, set, specimen},
|
||||
};
|
||||
|
||||
pub(super) fn keep<T: 'static>(
|
||||
key: &'static str,
|
||||
init: impl FnOnce() -> T,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) -> Entity<T> {
|
||||
window.use_keyed_state(key, cx, move |_, _| init())
|
||||
}
|
||||
|
||||
pub(super) fn set<T: 'static>(state: &Entity<T>, value: T, cx: &mut App) {
|
||||
state.update(cx, |state, cx| {
|
||||
*state = value;
|
||||
cx.notify();
|
||||
});
|
||||
}
|
||||
|
||||
fn values(list: &[&'static str]) -> Vec<SharedString> {
|
||||
list.iter()
|
||||
.map(|value| SharedString::from(*value))
|
||||
|
||||
Reference in new issue
Block a user