diff --git a/crates/ui-patterns/src/patterns/dock/mod.rs b/crates/ui-patterns/src/patterns/dock/mod.rs index ab247d2d67..4ccb311ec5 100644 --- a/crates/ui-patterns/src/patterns/dock/mod.rs +++ b/crates/ui-patterns/src/patterns/dock/mod.rs @@ -11,8 +11,8 @@ mod panes; pub use area::{DockArea, DockAreaOutput, InvalidGeometry}; pub use panes::{ - PaneArea, PaneAreaOutput, PaneCommands, PaneContent, PaneFrame, PaneFrameOutput, PaneFrameStyle, PanePlace, PaneRequest, PaneSpec, PaneState, - SidePolicy, + PaneArea, PaneAreaOutput, PaneCommands, PaneContent, PaneEdges, PaneFrame, PaneFrameOutput, PaneFrameStyle, PanePlace, PaneRequest, PaneSpec, + PaneState, SidePolicy, }; pub use switcher::{WorkspaceSwitcher, WorkspaceSwitcherOutput}; pub use words::WorkspaceDialogWords; diff --git a/crates/ui-patterns/src/patterns/dock/panes.rs b/crates/ui-patterns/src/patterns/dock/panes.rs index d4aa504b5a..d07e658c7b 100644 --- a/crates/ui-patterns/src/patterns/dock/panes.rs +++ b/crates/ui-patterns/src/patterns/dock/panes.rs @@ -186,6 +186,25 @@ pub struct PaneSpec { /// `true`: the body is one collection (a layers list, a bin) that owns the scroll. `false`: the pane scrolls its /// body. pub collection_body: bool, + /// The edges the pane may dock at; a request for another edge is refused and its commands are left out. + pub edges: PaneEdges, +} + +/// A set of dock edges. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct PaneEdges(u8); + +impl PaneEdges { + /// Every edge, the centre included. + pub const ALL: PaneEdges = PaneEdges(0b1_1111); + /// The four sides, without the centre. + pub const SIDES: PaneEdges = PaneEdges(0b1111); + + /// Whether `edge` is in the set. + pub fn contains(self, edge: PaneEdge) -> bool { + let _ = (self, edge); + todo!("ch.C12") + } } impl PaneSpec { @@ -200,6 +219,7 @@ impl PaneSpec { closable: true, title_bar: true, collection_body: false, + edges: PaneEdges::ALL, } } } diff --git a/crates/ui-patterns/src/patterns/form_dialogs/about.rs b/crates/ui-patterns/src/patterns/form_dialogs/about.rs index 916387830d..e5271e3ac5 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/about.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/about.rs @@ -104,6 +104,25 @@ pub enum AboutTab { Contributors, /// The credited AI models. Models, + /// The app's own tab at this position in the app's tabs, shown after Models. + App(u8), +} + +/// A tab the app adds after Models: a name for the hosted dialog's `tab` field, a title and a body. +pub struct AboutAppTab { + #[allow(dead_code)] // P3(chrome-w4): ch.C11 + name: &'static str, + #[allow(dead_code)] // P3(chrome-w4): ch.C11 + title: Label, + #[allow(dead_code)] // P3(chrome-w4): ch.C11 + body: Box, +} + +impl AboutAppTab { + /// A tab named `name` in the hosted dialog's `tab` field, titled `title`, whose content `body` draws. + pub fn new(name: &'static str, title: impl Into