use gpui::{ div, svg, AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable, IntoElement, ParentElement, Render, SharedString, Styled, Window, }; use ui::{ button::Button, dock_area::panel::{Panel, PanelEvent}, popup_menu::PopupMenu, theme::{scale::ColorScaleStep, ActiveTheme}, StyledExt, }; pub fn init(window: &mut Window, cx: &mut App) -> Entity { Welcome::new(window, cx) } pub struct Welcome { name: SharedString, closable: bool, zoomable: bool, focus_handle: FocusHandle, } impl Welcome { pub fn new(window: &mut Window, cx: &mut App) -> Entity { cx.new(|cx| Self::view(window, cx)) } fn view(_window: &mut Window, cx: &mut Context) -> Self { Self { name: "Welcome".into(), closable: true, zoomable: true, focus_handle: cx.focus_handle(), } } } impl Panel for Welcome { fn panel_id(&self) -> SharedString { "WelcomePanel".into() } fn title(&self, _cx: &App) -> AnyElement { self.name.clone().into_any_element() } fn closable(&self, _cx: &App) -> bool { self.closable } fn zoomable(&self, _cx: &App) -> bool { self.zoomable } fn popup_menu(&self, menu: PopupMenu, _cx: &App) -> PopupMenu { menu.track_focus(&self.focus_handle) } fn toolbar_buttons(&self, _window: &Window, _cx: &App) -> Vec