//! Every shell region; page two drops the right panel. mod dialogs; mod probe; mod props; use std::cell::RefCell; use std::rc::Rc; use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::time::{Duration, Instant}; use dialogs::Overlay; use ely_gpui_component::{ feedback::EmptyState, forms::TextInput, navigation::{EditorTab, EditorTabs}, primitives::{FocusRing as _, IconName}, shell::{StatusBar, StatusBarItem}, theme::ActiveTheme, }; use ely_platform::AppId; use ely_ui::{LongTask, Root, Shell, TaskState}; use gpui::{ App, AppContext as _, Bounds, Context, Entity, FocusHandle, InteractiveElement as _, IntoElement, ParentElement, Pixels, Render, SharedString, StatefulInteractiveElement as _, Styled, Window, canvas, div, prelude::FluentBuilder as _, px, }; use props::Props; fn main() { ely_ui::run(AppId::Doc, gallery); } fn gallery(app: AppId, window: &mut Window, cx: &mut App) -> Entity { let geometry = Rc::new(RefCell::new(None)); let view = cx.new(|cx| Gallery::new(window, cx, geometry)); let root = ely_ui::root(app, Some(view.clone().into()), window, cx); if std::env::var("ELY_GALLERY_PROBE").as_deref() == Ok("1") { let next = (root.clone(), view.clone()); window.on_next_frame(move |window, cx| probe::run(next.0, next.1, 0, window, cx)); } root } pub(crate) struct DemoPage { id: &'static str, title: SharedString, format: &'static str, } fn page(id: &'static str, title: &'static str, format: &'static str) -> DemoPage { DemoPage { id, title: title.into(), format, } } pub(crate) struct Gallery { focus: FocusHandle, page: SharedString, pages: Vec, selection: Vec, dialog: Option, task: Option>, beats_began: Arc, chip: FocusHandle, until: Option, frames: u8, probe_focused: Option, geometry: Rc>>>, content: Entity, nav: Entity