mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 02:09:00 +00:00
Overlay placement: a menu hung at a point also covers its anchor (photocraft#15552)
Most context menus hang from Anchor::Point (table header, rulers, ribbon, places, versions, dock group menu). layer_covers_anchor decides every case in one place: the pointer, the rect a context request named, and a point for a layer whose key class is OwnerClass::Menu. Point-anchored layers that are not menus (the iconic flyout, a popover at a point) keep their rule. docs/contract-api.md regenerated.
This commit is contained in:
@@ -178,16 +178,6 @@ impl crate::runtime::env::EnvValue for LayerFloor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether a layer opened by `opener` may cover the anchor [`opener_anchor`] gives it: the pointer, or the rect a context
|
||||
/// request named. Both are a context menu's anchor, a point or a row.
|
||||
pub(super) fn covers_anchor(opener: &Opener, opening: Opening, place: &Place) -> bool {
|
||||
match opener_anchor(opener, opening, place) {
|
||||
Anchor::Pointer => true,
|
||||
Anchor::Rect(_) => opener.anchor.is_none() && matches!(opening, Opening::At(_)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// The anchor a layer opened by `opener` hangs from: the opener's own, else the layer's `Pointer` or `Corner`
|
||||
/// place, else the pointer for a context request a secondary release made, else the rect a key's context request
|
||||
/// named, else the opener's rect.
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
//! Where a shown layer goes: its anchor, the region and screen it stays in, and the room its body has.
|
||||
|
||||
use super::host::{Layer, LayerMemory, memory_slot};
|
||||
use super::opener::{Opening, covers_anchor, opener_anchor};
|
||||
use super::opener::{Opening, opener_anchor};
|
||||
use super::place::{Anchor, OverlayFit, Place, ViewportShare};
|
||||
use super::props::Overlay;
|
||||
use crate::runtime::egui::areas::{self};
|
||||
use crate::runtime::env::Env;
|
||||
use crate::runtime::memory::MemoryStage;
|
||||
use crate::runtime::overlay::{self};
|
||||
use craft_behavior::OwnerClass;
|
||||
use craft_behavior::overlay::{PlaceRequest, Side};
|
||||
use egui::{Context, Id, Pos2, Rect};
|
||||
|
||||
@@ -51,15 +52,26 @@ pub(super) fn opened_overlay(ctx: &Context, overlay: &Overlay, stored: Option<Op
|
||||
Some((resolved, opening))
|
||||
}
|
||||
|
||||
/// Whether a layer of `overlay` may cover its anchor when it fits on neither side of it: it hangs from the pointer, or
|
||||
/// from the rect a context request named (`covers_anchor`). `stored` is the opening the layer decided.
|
||||
/// Whether a layer of `overlay` may cover its anchor when it fits on neither side of it: a context menu's anchor, which
|
||||
/// is the pointer, the rect a context request named, or for a menu (its key class is [`OwnerClass::Menu`]) a point.
|
||||
/// `stored` is the opening the layer decided.
|
||||
pub(super) fn layer_covers_anchor(ctx: &Context, overlay: &Overlay, stored: Option<Opening>) -> bool {
|
||||
match &overlay.opener {
|
||||
let (anchor, requested) = match &overlay.opener {
|
||||
Some(first) => {
|
||||
let (opener, opening) = first.active(ctx, stored);
|
||||
covers_anchor(opener, opening, &overlay.place)
|
||||
(opener_anchor(opener, opening, &overlay.place), opener.anchor.is_none() && matches!(opening, Opening::At(_)))
|
||||
}
|
||||
None => matches!(overlay.place, Place::Anchored { anchor: Anchor::Pointer, .. }),
|
||||
None => match &overlay.place {
|
||||
Place::Anchored { anchor, .. } => (anchor.clone(), false),
|
||||
Place::Float(_) => return false,
|
||||
},
|
||||
};
|
||||
match anchor {
|
||||
Anchor::Pointer => true,
|
||||
Anchor::Point(_) => overlay.keys == OwnerClass::Menu,
|
||||
// `opener_anchor` gives a requested rect only for a context request's opening.
|
||||
Anchor::Rect(_) => requested,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//! The table's header row and column widths: a double click on a column's edge fits the column to its widest cell in
|
||||
//! view, the header menu hides, shows and resets columns, Ctrl or Cmd with an arrow moves the focused column, and the
|
||||
//! metadata table's name column follows its widest name up to a third of the table.
|
||||
//! metadata table's name column follows its widest name up to a third of the table. A header menu too tall for either
|
||||
//! side of its point covers the point instead of scrolling.
|
||||
|
||||
use craft_behavior::{ColumnKey, ColumnWidth, keyed};
|
||||
use craft_host::target::Os;
|
||||
@@ -217,6 +218,38 @@ fn the_header_menu_hides_shows_and_resets_columns() {
|
||||
assert!(menu_row(&fixture, Role::MENU_ITEM, "Move Column Right").is_none(), "with no column there are no column commands");
|
||||
}
|
||||
|
||||
/// The hideable columns of a table whose header menu is taller than the room on either side of the point it opens at.
|
||||
const EXTRA: [&str; 14] =
|
||||
["Kind", "Owner", "Group", "Created", "Modified", "Opened", "Tags", "Rating", "Label", "Path", "Format", "Pixels", "Profile", "Author"];
|
||||
|
||||
/// A header menu opened at a point mid-window, too tall for the room above or below the point but not for the window,
|
||||
/// covers the point and shows every row.
|
||||
#[trial]
|
||||
fn a_header_menu_too_tall_for_either_side_of_its_point_covers_it_and_shows_every_row() {
|
||||
let mut fixture = Fixture::new(|ui| {
|
||||
ui.add_space(270.0);
|
||||
let mut columns = vec![ColumnSpec::new(NAME, "Name", ColumnWidth::Controls(4.0)).movable()];
|
||||
columns.extend(EXTRA.iter().map(|name| ColumnSpec::new(ColumnKey::new(name), *name, ColumnWidth::Controls(2.0)).hideable()));
|
||||
let keys = [0_usize];
|
||||
let source = keyed(&keys, |key: &usize| *key);
|
||||
Table::new("Files", columns).show_items(ui, &source, &mut |key, icx| ListRow::new(format!("File {key}")).cells(icx.cells()));
|
||||
});
|
||||
fixture.settle();
|
||||
let at = fixture.by_label("Name").expect("the header cell").center();
|
||||
secondary_click(&mut fixture, at);
|
||||
let room = fixture.ctx().content_rect();
|
||||
let first = menu_row(&fixture, Role::MENU_ITEM_CHECK_BOX, EXTRA[0]).expect("the first column's row").rect;
|
||||
let last = menu_row(&fixture, Role::MENU_ITEM, "Reset Columns").expect("the last row").rect;
|
||||
let tall = last.bottom() - first.top();
|
||||
assert!(tall > at.y - room.top() && tall > room.bottom() - at.y, "the rows ({tall}) fit on neither side of the point {at:?}");
|
||||
let menus = fixture.by_role(Role::MENU);
|
||||
assert!(!menus.is_empty(), "the header menu is open");
|
||||
for menu in menus {
|
||||
assert!(room.contains_rect(menu.rect), "the menu {:?} stays inside the window {room:?}", menu.rect);
|
||||
assert!(menu.rect.contains_rect(first) && menu.rect.contains_rect(last), "every row shows: {first:?} to {last:?} in {:?}", menu.rect);
|
||||
}
|
||||
}
|
||||
|
||||
/// Ctrl or Cmd with Right on a focused movable header moves its column one place on; Right alone moves the focus.
|
||||
/// macOS makes Cmd+Right a move to the line's end, which the header reads the same.
|
||||
#[trial]
|
||||
|
||||
+48
-16
@@ -538,11 +538,11 @@ The dock model: the tree of splits over panel frames, the side of a group a drop
|
||||
- `pub fn add_document(&mut self, document: &D)`. Adds `document` to the first docked group, or to a new docked group when there is none. A document a group
|
||||
- `pub fn to_actions<P: Clone + Eq + Hash>(&self, layout: &Layout<P>, panel_of: impl Fn(u64) -> P) -> Vec<Action<P>>`. The dock actions that put `self` into `layout`, for the dock to draw the windows. The
|
||||
- `craft_behavior::dock::Floating`: `pub struct Floating<P> { pub id: u64, pub column: Column<P>, pub rect: Rect, pub native: Option<Placement>, pub edge: Option<DockEdge> }`. A floating window: one column of groups, the same [`Column`] a dock holds. Nothing sits beside the column
|
||||
- `pub fn new(column: Column<P>, rect: Rect) -> Self`. A window holding `column`. Each call makes a new window, with a fresh [`Self::id`]: build
|
||||
- `pub fn single(panels: Vec<P>, active: usize, rect: Rect) -> Self`. A window with one group. Each call makes a new window, as [`Self::new`] does.
|
||||
- `pub fn with_id(mut self, id: u64) -> Self`. The window with `id`, for a layout the app builds in code, such as a default layout:
|
||||
- `pub fn new(id: u64, column: Column<P>, rect: Rect) -> Self`. The window `id` holding `column`. Ids are unique within a layout; a window added to a live layout takes its id
|
||||
- `pub fn single(id: u64, panels: Vec<P>, active: usize, rect: Rect) -> Self`. The window `id` with one group.
|
||||
- `pub fn with_id(mut self, id: u64) -> Self`. The window with `id` in place of its own. Ids must be unique within a layout.
|
||||
- `pub fn panels(&self) -> impl Iterator<Item = &P>`. Every panel in the window, top group first.
|
||||
- `pub fn stack(groups: Vec<Group<P>>, rect: Rect) -> Option<Self>`. A window of `groups`, stacked top to bottom, expanded. `None` without groups. Each call makes a new window,
|
||||
- `pub fn stack(id: u64, groups: Vec<Group<P>>, rect: Rect) -> Option<Self>`. The window `id` of `groups`, stacked top to bottom, expanded. `None` without groups.
|
||||
- `pub fn groups(&self) -> &[Group<P>]`. The window's groups, top to bottom.
|
||||
- `pub fn contains<Q: ?Sized + PartialEq>(&self, panel: &Q) -> bool where P: std::borrow::Borrow<Q>,`. True when a group of this window holds `panel`. Takes any borrowed form of `P`, such
|
||||
- `craft_behavior::dock::Group`: `pub struct Group<P> { pub panels: Vec<P>, pub active: usize, pub minimized: bool, pub height: Option<f32>, pub flyout_width: Option<f32>, pub flyout_offset: Option<f32> }`. Tabs that move, minimize and size together in a column, docked or floating.
|
||||
@@ -553,7 +553,9 @@ The dock model: the tree of splits over panel frames, the side of a group a drop
|
||||
- `pub const fn with_flyout_width(mut self, width: Option<f32>) -> Self`. The location with the group's flyout `width` points wide.
|
||||
- `pub const fn with_flyout_offset(mut self, offset: Option<f32>) -> Self`. The location with the group's flyout top `offset` points from its icons' top.
|
||||
- `craft_behavior::dock::Layout`: `pub struct Layout<P> { pub root: Option<Node<P>>, pub floating: Vec<Floating<P>> }`. The panels of a workspace: a docked tree plus floating windows. Every panel occurs once.
|
||||
- `pub fn new(root: Option<Node<P>>, floating: Vec<Floating<P>>) -> Self`. A layout with the docked tree `root` and the floating windows `floating`.
|
||||
- `pub fn new(root: Option<Node<P>>, floating: Vec<Floating<P>>) -> Self`. A layout with the docked tree `root` and the floating windows `floating`. New windows take ids above every id
|
||||
- `pub fn fresh_window_id(&mut self) -> u64`. An id for a new floating window: above every window id the layout held when it was built or loaded and every
|
||||
- `pub fn window_floor(&self) -> u64`. The least id above every id the layout holds or has held.
|
||||
- `pub fn validate(&self) -> Result<(), DockError>`. Check depth, allocation bounds, geometry, selection, globally unique panel ownership and
|
||||
- `pub fn panels(&self) -> Vec<&P>`. Iterate identities without recursion. On excessive input returns no more than the limit.
|
||||
- `pub fn contains(&self, panel: &P) -> bool`. Whether the layout holds `panel`, docked or floating.
|
||||
@@ -562,7 +564,7 @@ The dock model: the tree of splits over panel frames, the side of a group a drop
|
||||
- `pub fn panel_state(&self, panel: &P) -> PanelState`. Hidden, open behind another tab or in a collapsed container, or showing. In a column, docked or floating,
|
||||
- `pub fn restore(&mut self, panel: P, location: &Location<P>) -> Result<(), DockError>`. Restore an absent panel at a captured location. Missing anchors are reported without
|
||||
- `pub fn open_at_edge(&mut self, panel: P) -> Result<(), DockError>`. Open an absent panel as a frame at the outer edge of the docked area, taking most of it:
|
||||
- `craft_behavior::dock::Location`: `pub struct Location<P> { pub floating: Option<Rect>, pub anchor: Option<P>, pub placement: DockPlacement<P>, pub size: Option<SplitSize>, pub stack: Option<(bool, Option<f32>)>, pub sibling: Vec<P>, pub group: Option<GroupLocation> }`. A closed panel's former placement. Applications may retain this beside visibility flags.
|
||||
- `craft_behavior::dock::Location`: `pub struct Location<P> { pub floating: Option<Rect>, pub anchor: Option<P>, pub placement: DockPlacement<P>, pub size: Option<SplitSize>, pub stack: Option<(bool, Option<f32>)>, pub sibling: Vec<P>, pub group: Option<GroupLocation>, pub closed_with: Vec<P> }`. A closed panel's former placement. Applications may retain this beside visibility flags.
|
||||
- `pub fn new(anchor: Option<P>, placement: DockPlacement<P>) -> Self`. A location relative to `anchor` by `placement`, with no recorded sizes or siblings.
|
||||
- `craft_behavior::dock::MAX_DEPTH`: `pub const MAX_DEPTH: usize`. Limits are checked before cloning or recursively modifying an application layout.
|
||||
- `craft_behavior::dock::MAX_PANELS`: `pub const MAX_PANELS: usize`. Most panels a layout may hold. Larger layouts fail with [`DockError::LimitExceeded`](super::DockError::LimitExceeded).
|
||||
@@ -600,10 +602,17 @@ The dock model: the tree of splits over panel frames, the side of a group a drop
|
||||
- `pub fn new_dock(side: DockEdge) -> Self`. Builds [`Target::NewDock`].
|
||||
- `pub fn float(rect: Rect) -> Self`. Builds [`Target::Float`] with no edge: the area takes the edge nearer `rect`.
|
||||
- `pub fn float_with_edge(rect: Rect, edge: Option<DockEdge>) -> Self`. Builds [`Target::Float`] with the edge a collapsed window keeps to.
|
||||
- `craft_behavior::dock::Workspace`: `pub struct Workspace<P> { pub version: u32, pub layout: Layout<P>, pub hidden: Vec<(P, Location<P>)>, pub floated: Vec<(P, Location<P>)> }`. A saved arrangement of panels: the [`Layout`] and the closed panels' former places.
|
||||
- `craft_behavior::dock::Workspace`: `pub struct Workspace<P>`. A saved arrangement of panels: the [`Layout`] and the closed panels' former places.
|
||||
- `pub const VERSION: u32`. The format version written to files. Version 4 saves a floating window as one column; older floating
|
||||
- `pub fn revision(&self) -> u64`. The revision of this live workspace: it changes with every [`replace`](Self::replace) and nothing else.
|
||||
- `pub fn replace(&mut self, with: Workspace<P>)`. Replaces the arrangement with `with` and moves to the next revision.
|
||||
- `pub fn version(&self) -> u32`. The format version the workspace was read with.
|
||||
- `pub fn layout(&self) -> &Layout<P>`. The current arrangement.
|
||||
- `pub fn hidden(&self) -> &[(P, Location<P>)]`. The closed panels, and panels the application does not register now, with where each one goes back.
|
||||
- `pub fn floated(&self) -> &[(P, Location<P>)]`. The floating panels with the docked location each one left.
|
||||
- `pub fn revision(&self) -> Revision`. The revision of this workspace value: it moves with every write, and no other value has it.
|
||||
- `pub fn generation(&self) -> u64`. The generation of this live workspace: it moves with every [`replace`](Self::replace) and nothing else.
|
||||
- `pub fn raise_window_floor(&mut self, floor: u64)`. Keeps the ids of new floating windows at or above `floor`. A dock that showed windows below `floor` raises a
|
||||
- `pub fn forget_hidden(&mut self, forget: impl Fn(&P) -> bool)`. Drops the closed-panel records of the panels `forget` names, so reopening them does not restore their place.
|
||||
- `pub fn replace(&mut self, with: Workspace<P>)`. Replaces the arrangement with `with` and moves to the next generation. The windows of `with` take ids this
|
||||
- `pub fn apply(&mut self, action: Action<P>, locked: bool, permissions: impl Fn(&P) -> Permissions) -> Result<Vec<P>, DockError>`. Apply one action. Closed panels record where they go back, so each one can be reopened
|
||||
- `pub fn apply_all(&mut self, actions: impl IntoIterator<Item = Action<P>>, locked: bool, permissions: impl Fn(&P) -> Permissions,) -> Result<Vec<P>, DockError>`. Apply every action in order, or none, as [`Self::apply`] does. Returns the panels the
|
||||
- `craft_behavior::dock::WorkspaceChrome`: `pub struct WorkspaceChrome { pub menu_bar: bool, pub tool_rail: bool, pub options_bar: bool, pub status_bar: bool }`. Chrome a workspace remembers beside the dock layout: which bars show. The default shows every bar.
|
||||
@@ -1375,7 +1384,7 @@ The one-press-per-pass rule: a pass carries at most one press, as its last point
|
||||
- `craft_behavior::overlay::Align`: `pub enum Align { Start, Center, End }`. How the overlay lines up with the anchor along the edge it hangs from.
|
||||
- `craft_behavior::overlay::MinWidth`: `pub enum MinWidth { None, Anchor, Points(f32) }`. The narrowest an overlay may be.
|
||||
- `pub fn points(self, anchor_width: f32, side: Side) -> f32`. The width in points, given the anchor's width and the side the overlay takes: beside its anchor (`Start`,
|
||||
- `craft_behavior::overlay::PlaceRequest`: `pub struct PlaceRequest { pub anchor: Rect, pub size: Vec2, pub side: Side, pub align: Align, pub rtl: bool, pub gap: f32, pub min_width: MinWidth, pub bounds: Rect, pub kept: Option<Side>, pub flips_across: bool }`. What `place` reads.
|
||||
- `craft_behavior::overlay::PlaceRequest`: `pub struct PlaceRequest { pub anchor: Rect, pub size: Vec2, pub side: Side, pub align: Align, pub rtl: bool, pub gap: f32, pub min_width: MinWidth, pub bounds: Rect, pub kept: Option<Side>, pub flips_across: bool, pub covers_anchor: bool }`. What `place` reads.
|
||||
- `pub const fn new(anchor: Rect, size: Vec2, bounds: Rect) -> Self`. A request for `size` around `anchor` inside `bounds`: below, aligned to the start, no gap, free width.
|
||||
- `pub const fn size(mut self, size: Vec2) -> Self`. Sets the content size.
|
||||
- `pub const fn side(mut self, side: Side) -> Self`. Sets the preferred side.
|
||||
@@ -1385,6 +1394,7 @@ The one-press-per-pass rule: a pass carries at most one press, as its last point
|
||||
- `pub const fn min_width(mut self, min_width: MinWidth) -> Self`. Sets the narrowest width.
|
||||
- `pub const fn kept(mut self, side: Option<Side>) -> Self`. Keeps `side` instead of flipping.
|
||||
- `pub const fn flips_across(mut self, on: bool) -> Self`. Lines up with the anchor's other end, beside it, when that fits and the aligned end does not.
|
||||
- `pub const fn covers_anchor(mut self, on: bool) -> Self`. Below or above the anchor, slides over the anchor when the overlay fits neither side but fits the bounds.
|
||||
- `craft_behavior::overlay::Placement`: `pub struct Placement { pub rect: Rect, pub side: Side }`. Where `place` put the overlay.
|
||||
- `craft_behavior::overlay::Side`: `pub enum Side { Below, Above, Start, End }`. The side of the anchor an overlay prefers. `Start` and `End` follow the reading direction.
|
||||
- `craft_behavior::overlay::place`: `pub fn place(request: &PlaceRequest) -> Placement`. Places an overlay: the preferred side unless the other has more room and the content does not fit, shifted to
|
||||
@@ -1955,6 +1965,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `pub fn labelled_with<C: Show, D: Show>(&mut self, ui: &mut Ui, key: impl Hash + Debug, label: Label, side: SideLabel, child: C, content: D,) -> C::Output`. `labelled`, with `content` shown inside the label after its text (a sample of what the option picks). The
|
||||
- `pub fn style<C: Container>(&self) -> Option<&'a C::Style>`. The style of the container `C` whose body this is, as step 2 resolved it for this pass: the one way a body
|
||||
- `pub fn gap(&self) -> Option<f32>`. The gap the body's layout puts between its children (`ContainerProps::body_gap`), for a body that places
|
||||
- `pub fn derived<K: crate::contract::MemoProps, V: Send + Sync + 'static>(&self, key: &K, build: impl FnOnce() -> V) -> std::sync::Arc<V>`. The value this body derives from `key`: kept while `key` is unchanged, else built by `build`
|
||||
- `pub fn take_cancel(&mut self) -> bool`. Takes the Escape of this pass that no component took: a field that clears on Escape passes it on once it
|
||||
- `craft_ui::contract::BodyLayout`: `pub enum BodyLayout { Stack, Row { wrap: bool, align: RowAlign }, Grid { columns: Cow<'static, [ColumnWidth]>, fit: GridFit, cells: CellAlign } }`. How a body lays out its children, in reading order: mirrored under a right-to-left direction.
|
||||
- `pub const fn stack() -> Self`. Children one under another.
|
||||
@@ -1964,6 +1975,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `pub fn cells(self, cells: CellAlign) -> Self`. A `Grid` with `cells`; any other layout is unchanged.
|
||||
- `pub fn wrap(self, on: bool) -> Self`. A `Row` that wraps; any other layout is unchanged.
|
||||
- `pub fn align(self, align: RowAlign) -> Self`. A `Row` with `align`; any other layout is unchanged.
|
||||
- `craft_ui::contract::Bracket`: `pub enum Bracket { Linked, Unlinked }`. The bracket a `Row` draws from the labelled rows of its first child to the child after them (Image Size's width and
|
||||
- `craft_ui::contract::CanvasGesture`: re-export of `craft_ui::runtime::sampler::CanvasGesture`.
|
||||
- `craft_ui::contract::CellWidth`: `pub type CellWidth = ColumnWidth`. The width of a caption's cell.
|
||||
- `craft_ui::contract::Collapse`: `pub struct Collapse { pub initially_open: bool, pub animated: bool }`. Collapse configuration.
|
||||
@@ -1971,7 +1983,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `pub const fn initially_open(mut self, on: bool) -> Self`. Whether the body starts open.
|
||||
- `pub const fn animated(mut self, on: bool) -> Self`. Whether opening and closing animate.
|
||||
- `craft_ui::contract::CollectionEvent`: `pub enum CollectionEvent<K, E> { Selection(SelectionChange<K>), LeadMoved { key: K, by: LeadSource }, Activate(K), Rested(K), EmptyActivated, EmptyContextMenu { at: Pos2 }, Preview(K), ContextMenu(ContextMenuRequest<K>), EdgePressed { above: K, below: K, mods: craft_keymap::Mods }, CommandClick { key: K, mods: craft_keymap::Mods }, Delete(Vec<K>), Open(OpenChange<K>), Reorder(EditEvent<ReorderMove<K>>), Move(EditEvent<Vec2>), Dropped { at: DropAt<K>, op: DropOperation, payload: DropPayload }, Zoom { factor: f32, about: Pos2 }, Rename(EditEvent<Rename<K>>), Toggle(EditEvent<ToggleEdit<K>>), Column(ColumnEvent), Item(K, E) }`. What a collection reports, in drawing order.
|
||||
- `craft_ui::contract::CollectionProps`: `pub struct CollectionProps { pub select: SelectMode, pub reorder: Option<ReorderRule>, pub rename: bool, pub rename_column: Option<ColumnKey>, pub slow_click_rename: bool, pub columns: Vec<ColumnSpec>, pub sort: Option<ColumnSort>, pub empty: Option<Label>, pub activate: ActivateOn, pub striped: bool, pub allow_empty: bool, pub lead_on_open: LeadOnOpen, pub lead_follows_hover: bool, pub arrows_select: bool, pub focus_on_press: bool, pub rows_stamp: Option<u64>, pub space: SpaceAction, pub type_ahead: bool, pub arrows_wrap: bool, pub header: bool, pub digit_keys: bool, pub menu_on_click: bool, pub item_keys: ItemKeys, pub marquee: bool, pub deletable: bool, pub drag_payload: Option<DragPayload>, pub drag_count: Option<Counted>, pub natural_height: bool, pub min_rows: u16, pub max_rows: Option<u16>, pub row_height: RowHeight, pub command_click: bool, pub notch: Option<Notch>, pub overflow: Axis, pub pages: bool, pub current: Option<Arc<dyn Any + Send + Sync>>, pub select_under_drag: bool }`. What a collection reads from the app: plain data. A new builder's name is added to the forwarder list in
|
||||
- `craft_ui::contract::CollectionProps`: `pub struct CollectionProps { pub select: SelectMode, pub reorder: Option<ReorderRule>, pub rename: bool, pub rename_column: Option<ColumnKey>, pub slow_click_rename: bool, pub columns: Vec<ColumnSpec>, pub sort: Option<ColumnSort>, pub empty: Option<Label>, pub activate: ActivateOn, pub striped: bool, pub allow_empty: bool, pub lead_on_open: LeadOnOpen, pub hover_lead: HoverLead, pub arrows_select: bool, pub focus_on_press: bool, pub rows_stamp: Option<u64>, pub space: SpaceAction, pub type_ahead: bool, pub arrows_wrap: bool, pub header: bool, pub digit_keys: bool, pub menu_on_click: bool, pub item_keys: ItemKeys, pub marquee: bool, pub deletable: bool, pub drag_payload: Option<DragPayload>, pub drag_count: Option<Counted>, pub natural_height: bool, pub min_rows: u16, pub max_rows: Option<u16>, pub row_height: RowHeight, pub command_click: bool, pub notch: Option<Notch>, pub overflow: Axis, pub pages: bool, pub current: Option<Arc<dyn Any + Send + Sync>>, pub select_under_drag: bool }`. What a collection reads from the app: plain data. A new builder's name is added to the forwarder list in
|
||||
- `pub const fn new() -> Self`. Collection props with every setting at its default.
|
||||
- `pub const fn select_under_drag(mut self, on: bool) -> Self`. Whether a foreign drag resting over an unselected item selects it (`select_under_drag`).
|
||||
- `pub fn select(mut self, mode: SelectMode) -> Self`. What can be selected.
|
||||
@@ -1988,7 +2000,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `pub const fn striped(mut self, on: bool) -> Self`. Odd rows carry `RowState.striped`.
|
||||
- `pub const fn allow_empty(mut self, on: bool) -> Self`. A press on the empty space below the rows empties the selection.
|
||||
- `pub const fn lead_on_open(mut self, at: LeadOnOpen) -> Self`. Where the lead starts.
|
||||
- `pub const fn lead_follows_hover(mut self, on: bool) -> Self`. The lead follows the pointer over the rows.
|
||||
- `pub const fn hover_lead(mut self, hover: HoverLead) -> Self`. What the pointer moving over the rows changes.
|
||||
- `pub const fn arrows_select(mut self, on: bool) -> Self`. Whether the arrow keys select the row they move the lead to.
|
||||
- `pub const fn type_ahead(mut self, on: bool) -> Self`. Typed letters move the lead (`CollectionProps::type_ahead`).
|
||||
- `pub const fn arrows_wrap(mut self, on: bool) -> Self`. The arrow keys wrap at the ends (`CollectionProps::arrows_wrap`).
|
||||
@@ -2046,7 +2058,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `craft_ui::contract::Common`: `pub struct Common { pub label: Label, pub tooltip: Option<Tooltip>, pub description: Option<String>, pub selected: Option<bool> }`. What every component carries: the props the pipeline reads at step 1.
|
||||
- `pub const fn new() -> Common`. A `Common` with every prop unset, which the derive's constructors start from.
|
||||
- `craft_ui::contract::Component`: re-export of `craft_ui_macros::Component` (outside these crates).
|
||||
- `craft_ui::contract::ContainerProps`: `pub struct ContainerProps { pub mount: Mount, pub surface: Option<SurfaceKind>, pub pad: Pad, pub pad_edges: PadEdges, pub sizing: Sizing, pub content_in_bar: bool, pub room_height: Option<f32>, pub layout: BodyLayout, pub header: Option<HeaderRegion>, pub scroll: Option<Scroll>, pub footer: Option<FooterRegion>, pub end: Option<EndRegion>, pub help: Option<Label>, pub position: Option<SetPosition>, pub focus: FocusPolicy, pub collapse: Option<Collapse>, pub body_gap: Gap, pub least_width: Option<LeastWidth>, pub wrap_width: Option<WrapWidth>, pub edge_rule: bool, pub child_size: Option<ControlSize>, pub child_glyphs: Option<GlyphRole>, pub arena: bool, pub scroll_owner: bool, pub gates: bool, pub transform: Option<CanvasTransform>, pub theme: Option<ThemeScope>, pub command_scope: Option<CommandScope>, pub live: Option<Politeness>, pub label: Option<SideLabel>, pub roving: Option<Roving>, pub save: Option<SaveKey>, pub outer_edit: bool, pub collection_body: bool, pub label_column: bool, pub labels: Option<LabelScheme> }`. What a container or collection adds to `Common`. A builder added here is added to the forwarder list in
|
||||
- `craft_ui::contract::ContainerProps`: `pub struct ContainerProps { pub mount: Mount, pub surface: Option<SurfaceKind>, pub pad: Pad, pub pad_edges: PadEdges, pub sizing: Sizing, pub content_in_bar: bool, pub room_height: Option<f32>, pub layout: BodyLayout, pub header: Option<HeaderRegion>, pub scroll: Option<Scroll>, pub footer: Option<FooterRegion>, pub end: Option<EndRegion>, pub help: Option<Label>, pub position: Option<SetPosition>, pub focus: FocusPolicy, pub collapse: Option<Collapse>, pub body_gap: Gap, pub least_width: Option<LeastWidth>, pub wrap_width: Option<WrapWidth>, pub edge_rule: bool, pub child_size: Option<ControlSize>, pub child_glyphs: Option<GlyphRole>, pub arena: bool, pub scroll_owner: bool, pub gates: bool, pub transform: Option<CanvasTransform>, pub theme: Option<ThemeScope>, pub command_scope: Option<CommandScope>, pub live: Option<Politeness>, pub label: Option<SideLabel>, pub roving: Option<Roving>, pub save: Option<SaveKey>, pub outer_edit: bool, pub collection_body: bool, pub label_column: bool, pub labels: Option<LabelScheme>, pub bracket: Option<Bracket> }`. What a container or collection adds to `Common`. A builder added here is added to the forwarder list in
|
||||
- `pub const fn new() -> Self`. Props with every field at its default.
|
||||
- `pub fn mount(mut self, mount: Mount) -> Self`. Where the container lives.
|
||||
- `pub const fn surface(mut self, surface: SurfaceKind) -> Self`. The surface the container paints.
|
||||
@@ -2082,6 +2094,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `pub fn save(mut self, key: SaveKey) -> Self`. Saves placement, size and open state under `key`.
|
||||
- `pub const fn outer_edit(mut self, on: bool) -> Self`. One outer gesture over the body's fields, from open to close.
|
||||
- `pub const fn label_column(mut self, on: bool) -> Self`. The labelled rows of the body share the widest label as one column. A nested container with its own
|
||||
- `pub const fn bracket(mut self, bracket: Bracket) -> Self`. The bracket of a `Row` from its first child's labelled rows to the child after them ([`bracket`](Self::bracket)).
|
||||
- `pub const fn labels(mut self, scheme: LabelScheme) -> Self`. The labelled rows under the container show their labels in `scheme`: its regions, its body and every container
|
||||
- `craft_ui::contract::ContextMenuRequest`: `pub struct ContextMenuRequest<K> { pub key: K, pub at: Pos2, pub column: Option<ColumnKey>, pub part: Option<PartRef> }`. A request for the context menu of an item. Collections never open menus: the app does.
|
||||
- `pub fn new(key: K, at: Pos2) -> Self`. A request for the menu of `key` that opens at `at`, from the item itself: no column and no part. A component
|
||||
@@ -2244,6 +2257,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
|
||||
- `fn show(self: Box<Self>, ui: &mut PaintUi<'_>, key: HostedKey, rect: Rect)`. Shows the leaf at `rect` under `key` and hands its output on.
|
||||
- `craft_ui::contract::HostedKey`: `pub type HostedKey = (&'static str, usize)`. The key a hosted leaf is measured and shown under: the slot's name and its index among the host's slots.
|
||||
- `craft_ui::contract::Hover`: `pub struct Hover { pub over: bool, pub entered: bool, pub left: bool, pub clicked: bool }`. A command-bound control's report of the pointer's stay over it.
|
||||
- `craft_ui::contract::HoverLead`: `pub enum HoverLead { Off, Lead, LeadAndSelection }`. What the pointer moving over the rows changes.
|
||||
- `craft_ui::contract::Input`: re-export of `craft_behavior::input::Input`.
|
||||
- `craft_ui::contract::InsideLabel`: `pub struct InsideLabel`. What a control shows in its slot for a side label with `FieldLayout::Inside` (`EnvView::inside_label`): the
|
||||
- `pub const PART: PartKey`. The part a control declares its slot as (`PartsCx::label_part`).
|
||||
@@ -2748,6 +2762,7 @@ Chapter 15: the `Overlay` data, its presets, popup handles, `OverlayUi` and the
|
||||
- `craft_ui::contract::overlay::close_popups`: re-export of `craft_ui::runtime::overlay::close_popups`.
|
||||
- `craft_ui::contract::overlay::family`: re-export of `craft_ui::runtime::overlay::family`.
|
||||
- `craft_ui::contract::overlay::is_open`: re-export of `craft_ui::runtime::overlay::is_open`.
|
||||
- `craft_ui::contract::overlay::layer_room`: `pub fn layer_room(ctx: &Context) -> Rect`. The room a layer opened in the running viewport may take, in its points: the work area around a palette window,
|
||||
- `craft_ui::contract::overlay::paint_frame_layers`: `pub fn paint_frame_layers(ctx: &Context)`. Paints the ghost egui layer from runtime data: the drag preview and drop mark, and the painted cursor the cursor
|
||||
- `craft_ui::contract::overlay::request_close`: re-export of `craft_ui::runtime::overlay::request_close`.
|
||||
- `craft_ui::contract::overlay::top`: re-export of `craft_ui::runtime::overlay::top`.
|
||||
@@ -3042,6 +3057,8 @@ Painters, `Draw`, the sensing core, the text adapter and `ImeSurface`.
|
||||
- `pub fn strip_arrow(strip: Rect, back: bool, color: Color32) -> Shape`. The filled arrow of a scroll strip, centred in `strip`: pointing up for the strip before the view (`back`),
|
||||
- `pub fn thumb(min_thumb: f32, track: Rect, axis: Axis, rtl: bool, span: &ScrollSpan) -> Rect`. The thumb inside `track`, a bar along `axis`, for `span`: its length is the shown share of the track, at least
|
||||
- `pub fn shapes(look: &ScrollBarLook, track: Rect, axis: Axis, rtl: bool, span: &ScrollSpan, state: &StateSet) -> Vec<Shape>`. The shapes of the bar in `track` along `axis` for `span`, in `state` (the bar's: hovered while the pointer is
|
||||
- `craft_ui::primitives::Serials`: `pub struct Serials`. The numbers that keep apart the textures one owner makes: a mask or preview made anew gets a number no earlier one
|
||||
- `pub fn mint(&mut self) -> u64`. A new number: never one this `Serials` gave before.
|
||||
- `craft_ui::primitives::Span`: `pub struct Span<'a> { pub text: Cow<'a, str>, pub italic: bool, pub tabular: bool, pub mono: bool, pub muted: bool, pub shortcut: bool, pub highlight: bool, pub underline: bool, pub strong: bool, pub flag: Option<Tone> }`. One styled stretch of a run.
|
||||
- `pub fn new(text: impl Into<Cow<'a, str>>) -> Self`. A plain span.
|
||||
- `pub fn flag(mut self, tone: Tone) -> Self`. Underlines the span in the ink of `tone` (spelling `Bad`, grammar `Info`).
|
||||
@@ -3242,6 +3259,8 @@ Frosted backdrops: a bounded blurred composition of the layers under a surface,
|
||||
- `pub const fn new(value: u64) -> Revision`. The revision `value` (a document's own change counter).
|
||||
- `pub const fn get(self) -> u64`. The number.
|
||||
- `pub fn of(value: &impl Hash) -> Revision`. The revision of anything hashable: `Revision::of(&(fingerprint, doc_width))`. Stable within one run of the
|
||||
- `craft_ui::primitives::textures::Serials`: `pub struct Serials`. The numbers that keep apart the textures one owner makes: a mask or preview made anew gets a number no earlier one
|
||||
- `pub fn mint(&mut self) -> u64`. A new number: never one this `Serials` gave before.
|
||||
- `craft_ui::primitives::textures::TextureBudget`: `pub struct TextureBudget { pub max_bytes: usize, pub max_entries: usize, pub uploads_per_pass: usize, pub upload_bytes_per_pass: usize }`. How much a store may hold and upload. Entries past `max_bytes` or `max_entries` are evicted; `uploads_per_pass`
|
||||
- `pub const fn new(max_bytes: usize, max_entries: usize) -> Self`. Holds `max_bytes` and `max_entries`; a loader uploads 16 pictures and 16 MiB per frame.
|
||||
- `pub const fn uploads(mut self, count: usize, bytes: usize) -> Self`. Other upload limits per frame.
|
||||
@@ -3515,6 +3534,12 @@ The cursor service (8.5): requests of a pass collect here, the end hook picks th
|
||||
- `pub fn new(layer: LayerKey, clip: Rect) -> Self`. The region of `clip` on `layer`.
|
||||
- `craft_ui::runtime::cursor::current`: `pub fn current(ctx: &Context) -> Option<Cursor>`. The cursor the last pass of the running viewport settled on; `None` is the default arrow.
|
||||
|
||||
## `craft_ui::runtime::derived`
|
||||
|
||||
Derived values: data a component computes from its inputs and keeps across passes. [`derived`] keeps one value per
|
||||
|
||||
- `craft_ui::runtime::derived::derived`: `pub fn derived<K: MemoProps, V: Send + Sync + 'static>(ctx: &Context, id: Id, key: &K, build: impl FnOnce() -> V) -> Arc<V>`. The value of the component `id` derived from `key`: the kept one while `key` is the one it was built from, else
|
||||
|
||||
## `craft_ui::runtime::drag`
|
||||
|
||||
The drag session (8.4): one per context. It holds the payload, the preview, the held modifiers, the operation and the
|
||||
@@ -4222,7 +4247,7 @@ The toast queues: one per window (`WindowKey`), filled from any code with a `Con
|
||||
- `craft_ui::runtime::windows::ScreenshotError`: re-export of `craft_ui::runtime::egui::screenshot::ScreenshotError`.
|
||||
- `craft_ui::runtime::windows::ScreenshotFacts`: re-export of `craft_ui::runtime::egui::screenshot::ScreenshotFacts`.
|
||||
- `craft_ui::runtime::windows::ScreenshotSlot`: re-export of `craft_ui::runtime::egui::screenshot::ScreenshotSlot`.
|
||||
- `craft_ui::runtime::windows::WindowAction`: `pub enum WindowAction { Close, Minimize, ToggleMaximize, ToggleFullscreen, SetFullscreen(bool), SetMaximized(bool), Focus, StartMove, StartResize(ResizeEdge), SetOuterPosition(Pos2), SetInnerSize(Vec2), Restore, SetMinInnerSize(Vec2), SetLevel(WindowLevel), SetTitle(String), SetOpacity(f32) }`. A window command `act` sends.
|
||||
- `craft_ui::runtime::windows::WindowAction`: `pub enum WindowAction { Close, Minimize, ToggleMaximize, ToggleFullscreen, SetFullscreen(bool), SetMaximized(bool), Focus, Raise, StartMove, StartResize(ResizeEdge), SetOuterPosition(Pos2), SetInnerSize(Vec2), Restore, SetMinInnerSize(Vec2), SetLevel(WindowLevel), SetTitle(String), SetOpacity(f32) }`. A window command `act` sends.
|
||||
- `craft_ui::runtime::windows::WindowFacts`: `pub struct WindowFacts { pub inner: Rect, pub outer: Option<Rect>, pub scale: Option<f32>, pub state: WindowState, pub focused: bool }`. What the OS tells about a window, in desktop points.
|
||||
- `craft_ui::runtime::windows::WindowHit`: `pub enum WindowHit { Move, Resize(ResizeEdge), Caption(Button) }`. What a part of the window does for the operating system: a press on it moves the window, resizes it from an edge,
|
||||
- `craft_ui::runtime::windows::WindowHost`: `pub struct WindowHost`. The multi-window driver of one context.
|
||||
@@ -4278,8 +4303,9 @@ The toast queues: one per window (`WindowKey`), filled from any code with a `Con
|
||||
- `pub fn install_hit_sink(&self, viewport: ViewportId) -> HitSink`. The hit-test sink of `viewport`'s window, made on the first call. The platform layer calls it once it has put
|
||||
- `pub fn pointer_in(&self, viewport: ViewportId) -> Option<Pos2>`. The desktop pointer in the coordinates of `viewport`, when it lies inside that window.
|
||||
- `craft_ui::runtime::windows::WindowLevel`: `pub enum WindowLevel { Normal, Palette, AlwaysOnTop }`. Where a window stands in the stack of windows.
|
||||
- `craft_ui::runtime::windows::WindowSpec`: `pub struct WindowSpec { pub kind: WindowKind, pub chrome: Option<WindowChrome>, pub captions: Option<Captions>, pub level: WindowLevel, pub taskbar: bool, pub shown_after_first_paint: bool }`. How an OS window opens (21.2): what it is for, who draws its frame, where it stands and whether it has a taskbar
|
||||
- `craft_ui::runtime::windows::WindowSpec`: `pub struct WindowSpec { pub kind: WindowKind, pub chrome: Option<WindowChrome>, pub captions: Option<Captions>, pub level: WindowLevel, pub taskbar: bool, pub shown_after_first_paint: bool, pub takes_focus: bool, pub passes_pointer: bool }`. How an OS window opens (21.2): what it is for, who draws its frame, where it stands and whether it has a taskbar
|
||||
- `pub fn tool() -> Self`. A tool window (a native dock window): its own title row in place of the OS title bar
|
||||
- `pub fn popup() -> Self`. A popup window: a layer opened from a palette window (a flyout, menu or tooltip) in an OS window of its own. It
|
||||
- `pub fn document() -> Self`. A document window with the installed decision's frame.
|
||||
- `pub fn dialog() -> Self`. A dialog window with the installed decision's frame.
|
||||
- `pub fn kind(mut self, kind: WindowKind) -> Self`. Sets what the window is for.
|
||||
@@ -4288,6 +4314,8 @@ The toast queues: one per window (`WindowKey`), filled from any code with a `Con
|
||||
- `pub fn frame(mut self, frame: &Frame) -> Self`. Takes the chrome and the captions from a decided `frame`; a frame without buttons has no captions.
|
||||
- `pub fn level(mut self, level: WindowLevel) -> Self`. Sets the level.
|
||||
- `pub fn taskbar(mut self, taskbar: bool) -> Self`. Sets whether the window has a taskbar or Dock entry.
|
||||
- `pub fn takes_focus(mut self, takes_focus: bool) -> Self`. Sets whether the window takes OS focus when it opens.
|
||||
- `pub fn passes_pointer(mut self, passes_pointer: bool) -> Self`. Sets whether pointer input passes through the window to the window below it (a tooltip's).
|
||||
- `craft_ui::runtime::windows::act`: `pub fn act(ctx: &Context, viewport: ViewportId, action: WindowAction) -> bool`. Sends `action` to `viewport`. It is the only sender of window commands: it checks the capabilities and the
|
||||
- `craft_ui::runtime::windows::double_click_action`: `pub fn double_click_action(frame: &Frame, setting: DoubleClick, maximized: bool) -> Option<WindowAction>`. What a double click on a window's free move band (its title bar, or the strip a modal leaves over it) asks of the
|
||||
|
||||
@@ -4324,6 +4352,7 @@ The style layer: the state set and its resolver, style parts and `ComponentStyle
|
||||
- `pub fn on(mut self, ground: Stateful<StyleColor>) -> Self`. Declares the fill the icon is painted on, for an icon that sits on a part's own fill.
|
||||
- `craft_ui::style::Ink`: `pub enum Ink { OnPanel, OnDark, Accent }`. The text and icon colour that reads on a surface, resolved at step 12.
|
||||
- `craft_ui::style::Insets`: re-export of `craft_behavior::flow::Insets`.
|
||||
- `craft_ui::style::LetterCase`: re-export of `craft_theme::LetterCase` (outside these crates).
|
||||
- `craft_ui::style::MarkerLook`: `pub struct MarkerLook { pub radius: f32, pub large: f32, pub ring: StyleColor, pub selected: StyleColor, pub ring_width: f32, pub halo: StyleColor, pub halo_width: f32, pub backing: StyleColor }`. A colour marker: the mark on a colour field, wheel, disc or gradient line that shows where a colour sits. Its ring
|
||||
- `craft_ui::style::Metrics`: re-export of `craft_behavior::sizing::Metrics`.
|
||||
- `craft_ui::style::Mix`: re-export of `craft_theme::Mix` (outside these crates).
|
||||
@@ -4336,7 +4365,7 @@ The style layer: the state set and its resolver, style parts and `ComponentStyle
|
||||
- `pub fn pixels(self, pixels_per_point: f32) -> f32`. The width in whole physical pixels on a display of `pixels_per_point`.
|
||||
- `pub fn points(self, pixels_per_point: f32) -> f32`. The width in points on a display of `pixels_per_point`.
|
||||
- `craft_ui::style::ScrollBarKind`: `pub enum ScrollBarKind { Floating, Docked }`. Which of the two scroll bar looks a bar has.
|
||||
- `craft_ui::style::ScrollBarLook`: `pub struct ScrollBarLook { pub track: Stateful<StyleColor>, pub thumb: Stateful<StyleColor>, pub thickness: f32, pub thumb_width: Stateful<f32>, pub min_thumb: f32, pub fade: f32 }`. A scroll bar's track and thumb, of a [`ScrollBarKind`].
|
||||
- `craft_ui::style::ScrollBarLook`: `pub struct ScrollBarLook { pub track: Stateful<StyleColor>, pub thumb: Stateful<StyleColor>, pub thickness: f32, pub thumb_width: Stateful<f32>, pub min_thumb: f32 }`. A scroll bar's track and thumb, of a [`ScrollBarKind`].
|
||||
- `craft_ui::style::Span`: `pub struct Span<'a> { pub text: Cow<'a, str>, pub italic: bool, pub tabular: bool, pub mono: bool, pub muted: bool, pub shortcut: bool, pub highlight: bool, pub underline: bool, pub strong: bool, pub flag: Option<Tone> }`. One styled stretch of a run.
|
||||
- `pub fn new(text: impl Into<Cow<'a, str>>) -> Self`. A plain span.
|
||||
- `pub fn flag(mut self, tone: Tone) -> Self`. Underlines the span in the ink of `tone` (spelling `Bad`, grammar `Info`).
|
||||
@@ -4473,7 +4502,9 @@ The fixture, the suite runner and the story helpers.
|
||||
- `craft_ui::testing::install_spec`: re-export of `craft_ui::testing::windows::install_spec`.
|
||||
- `craft_ui::testing::is_measuring`: re-export of `craft_ui::runtime::measure::active` (defined outside these crates).
|
||||
- `craft_ui::testing::kept_measurement_leaves`: re-export of `craft_ui::runtime::layout_memory::kept_leaves`.
|
||||
- `craft_ui::testing::last_frame_derived_builds`: re-export of `craft_ui::runtime::measure::last_frame_derived_builds` (defined outside these crates).
|
||||
- `craft_ui::testing::last_frame_memo_runs`: re-export of `craft_ui::runtime::measure::last_frame_memo_runs` (defined outside these crates).
|
||||
- `craft_ui::testing::last_pass_derived_builds`: re-export of `craft_ui::runtime::measure::last_pass_derived_builds` (defined outside these crates).
|
||||
- `craft_ui::testing::last_pass_measure_asks`: re-export of `craft_ui::runtime::measure::last_pass_measure_asks` (defined outside these crates).
|
||||
- `craft_ui::testing::last_pass_measuring_runs`: re-export of `craft_ui::runtime::measure::last_pass_body_runs` (defined outside these crates).
|
||||
- `craft_ui::testing::last_pass_memo_key_bytes`: re-export of `craft_ui::runtime::measure::last_pass_memo_key_bytes` (defined outside these crates).
|
||||
@@ -4636,6 +4667,7 @@ Text dumps for tests: ordered `key = value` lines compared exactly with a file,
|
||||
- `pub fn take_paint(&mut self) -> Option<fixture::FullOutput>`. What the frames painted since the last call, as a renderer takes it: the latest frame's shapes and every texture
|
||||
- `pub fn command_state(&mut self, command: impl Into<CommandRef>, state: CommandState) -> &mut Self`. Gives app-scope `command` this state in every following pass, as an app's `FrameInput.commands` does; a later
|
||||
- `pub fn gate(&mut self, gate: CommandGate) -> &mut Self`. Sets the app's one gate over commands for every following pass, as an app's `FrameInput.commands` does.
|
||||
- `pub fn overrides(&mut self, overrides: std::sync::Arc<craft_keymap::Overrides>) -> &mut Self`. Sets the user's binding overrides for every following pass, as an app's `FrameInput.commands` does: the keymap is
|
||||
- `pub fn room(&mut self, room: Vec2) -> &mut Self`. The room the story is shown in.
|
||||
- `pub fn in_room(&mut self, room: Room) -> &mut Self`. The room of a host kind: the same as [`Fixture::room`] with that kind's size.
|
||||
- `pub fn direction(&mut self, direction: Direction) -> &mut Self`. The layout direction.
|
||||
|
||||
Reference in New Issue
Block a user