Skip to main content

Crate zaxis

Crate zaxis 

Source
Expand description

Immediate mode desktop UI with retained interaction state and cached geometry.

Implement App::update and call run to open a desktop window. The runner handles events, repaint deadlines, and GPU recovery.

For custom integrations, feed window events to Context::on_window_event, run Context::run on redraw, then present with Renderer::render. Every redraw evaluates the UI; unchanged geometry stays cached. Widget activation and value changes automatically schedule a follow-up redraw. Outside model changes only need a native redraw; the host should sleep between events and honor Context::needs_repaint.

Re-exports§

pub use accessibility::AccessAction;
pub use accessibility::AccessActionKind;
pub use accessibility::AccessLive;
pub use accessibility::AccessNode;
pub use accessibility::AccessOrientation;
pub use accessibility::AccessRole;
pub use accessibility::AccessToggled;
pub use accessibility::Accessible;
pub use actions::Action;
pub use actions::Actions;
pub use actions::Binding;
pub use actions::Chord;
pub use actions::ChordError;
pub use actions::Conflict;
pub use actions::ConflictKind;
pub use actions::Kbd;
pub use actions::Keymap;
pub use actions::KeymapIssue;
pub use actions::Mods;
pub use actions::Platform;
pub use actions::Stroke;
pub use animation::Animated;
pub use animation::Animation;
pub use animation::AnimationOptions;
pub use animation::AnimationSample;
pub use animation::AnimationStatus;
pub use animation::Decay;
pub use animation::DecayOptions;
pub use animation::Delay;
pub use animation::Easing;
pub use animation::Interpolate;
pub use animation::Keyframe;
pub use animation::Keyframes;
pub use animation::MotionStyle;
pub use animation::Oklab;
pub use animation::Parallel;
pub use animation::Path;
pub use animation::PathFollow;
pub use animation::PathPose;
pub use animation::Procedural;
pub use animation::Pulse;
pub use animation::Repeat;
pub use animation::Rotation;
pub use animation::Sequence;
pub use animation::Spring;
pub use animation::SpringOptions;
pub use animation::SpringState;
pub use animation::SpringValue;
pub use animation::Stagger;
pub use animation::Tween;
pub use animation::TweenOptions;
pub use animation::Wake;
pub use app::run;
pub use app::run_with_options;
pub use app::App;
pub use app::AppStats;
pub use app::CloseRequested;
pub use app::CloseSource;
pub use app::ExitPolicy;
pub use app::Frame;
pub use app::GlobalShortcut;
pub use app::OpenOutcome;
pub use app::RunError;
pub use app::RunOptions;
pub use app::WebBackend;
pub use app::WebOptions;
pub use app::WindowError;
pub use app::WindowInfo;
pub use app::WindowKey;
pub use app::WindowOptions;
pub use app::WindowPlan;
pub use app::WindowStatus;
pub use app::Windows;
pub use components::dock::Dock;
pub use components::dock::DockActions;
pub use components::dock::DockChild;
pub use components::dock::DockDropZone;
pub use components::dock::DockError;
pub use components::dock::DockEvent;
pub use components::dock::DockFloat;
pub use components::dock::DockIssue;
pub use components::dock::DockMotion;
pub use components::dock::DockNode;
pub use components::dock::DockOutput;
pub use components::dock::DockPanelOutput;
pub use components::dock::DockPreset;
pub use components::dock::DockSide;
pub use components::dock::DockState;
pub use components::dock::DockStyle;
pub use components::dock::DockViewer;
pub use components::dock::PanelId;
pub use components::move_item;
pub use components::DragEffect;
pub use components::DragEnd;
pub use components::DragOutput;
pub use components::DragReason;
pub use components::DragSource;
pub use components::DragStyle;
pub use components::DropOutput;
pub use components::DropTarget;
pub use components::DropZones;
pub use components::Dropped;
pub use components::Insertion;
pub use components::PreviewKind;
pub use components::RowDrag;
pub use components::RowMove;
pub use components::TreeNodeDrag;
pub use components::tab_after_close;
pub use components::Align;
pub use components::Badge;
pub use components::Blur;
pub use components::Button;
pub use components::ButtonVariant;
pub use components::Card;
pub use components::CardOutput;
pub use components::CardVariant;
pub use components::Carousel;
pub use components::CarouselIndicator;
pub use components::CarouselOrientation;
pub use components::CarouselOutput;
pub use components::CarouselPage;
pub use components::CarouselStyle;
pub use components::CarouselVariant;
pub use components::Checkbox;
pub use components::ColorPicker;
pub use components::ColorPickerType;
pub use components::Column;
pub use components::ColumnWidth;
pub use components::ComboBox;
pub use components::ComboBoxOption;
pub use components::ComboBoxStyle;
pub use components::ContextMenu;
pub use components::ContextMenuItem;
pub use components::ContextMenuOutput;
pub use components::ContextMenuStyle;
pub use components::ContextMenuWidget;
pub use components::DragValue;
pub use components::Field;
pub use components::Grid;
pub use components::GridOutput;
pub use components::GridRow;
pub use components::GridStyle;
pub use components::GridUi;
pub use components::Hover;
pub use components::HoverFill;
pub use components::HoverStyle;
pub use components::IconTabs;
pub use components::Image;
pub use components::ImageFit;
pub use components::ImageOutput;
pub use components::IndicatorPosition;
pub use components::KeyBinding;
pub use components::KeyBox;
pub use components::ListBox;
pub use components::ListBoxStyle;
pub use components::ListDensity;
pub use components::ListEntry;
pub use components::ListEntryKind;
pub use components::ListEvent;
pub use components::ListMode;
pub use components::ListModel;
pub use components::ListOutput;
pub use components::ListRow;
pub use components::Loader;
pub use components::MaterialPaint;
pub use components::MenuBar;
pub use components::MenuBarOutput;
pub use components::MenuItem;
pub use components::MouseBinding;
pub use components::NumberInput;
pub use components::NumberStyle;
pub use components::Numeric;
pub use components::Popup;
pub use components::PopupOutput;
pub use components::Presence;
pub use components::Progress;
pub use components::ProgressState;
pub use components::RadioGroup;
pub use components::RadioLayout;
pub use components::RadioOption;
pub use components::RadioSize;
pub use components::Reorder;
pub use components::ReorderUi;
pub use components::Response;
pub use components::Root;
pub use components::RowPresence;
pub use components::ScrollArea;
pub use components::ScrollAreaOutput;
pub use components::ScrollStyle;
pub use components::SegmentOption;
pub use components::SegmentWidth;
pub use components::SegmentedControl;
pub use components::SegmentedOrientation;
pub use components::SegmentedSize;
pub use components::SegmentedVariant;
pub use components::SelectionIndicator;
pub use components::Sense;
pub use components::Separator;
pub use components::Skeleton;
pub use components::Slider;
pub use components::SliderStatus;
pub use components::SortDirection;
pub use components::SortRequest;
pub use components::SplitBoundaryOutput;
pub use components::SplitHandle;
pub use components::SplitHandleStyle;
pub use components::SplitOutput;
pub use components::SplitPane;
pub use components::SplitPanel;
pub use components::SplitPanelOutput;
pub use components::SplitSize;
pub use components::SplitStyle;
pub use components::SplitSurface;
pub use components::SplitUi;
pub use components::StackDirection;
pub use components::Style;
pub use components::Switch;
pub use components::TabActivation;
pub use components::TabBar;
pub use components::TabBarOutput;
pub use components::TabDrag;
pub use components::TabDropZone;
pub use components::TabDropZoneOutput;
pub use components::TabItem;
pub use components::TabMove;
pub use components::TabRelease;
pub use components::TabVariant;
pub use components::TabWidth;
pub use components::Table;
pub use components::TableBody;
pub use components::TableOutput;
pub use components::TableStyle;
pub use components::TabsStyle;
pub use components::Text;
pub use components::TextEdit;
pub use components::TitleBar;
pub use components::TitleBarResponse;
pub use components::Toast;
pub use components::Tooltip;
pub use components::TooltipStyle;
pub use components::TooltipWidget;
pub use components::Ui;
pub use components::Validation;
pub use components::Widget;
pub use components::WidgetState;
pub use components::Window;
pub use components::CloseReason;
pub use components::Confirm;
pub use components::Confirmation;
pub use components::Dialog;
pub use components::DialogAction;
pub use components::DialogOutput;
pub use components::Modal;
pub use components::ModalAnchor;
pub use components::ModalOutput;
pub use components::CollapsingHeader;
pub use components::CollapsingOutput;
pub use components::CollapsingStyle;
pub use components::DisclosureStyle;
pub use components::TreeChildren;
pub use components::TreeEvent;
pub use components::TreeIssue;
pub use components::TreeModel;
pub use components::TreeNode;
pub use components::TreeOutput;
pub use components::TreeStyle;
pub use components::TreeView;
pub use components::FocusGroup;
pub use components::FocusGroupOutput;
pub use components::HyperlinkOutput;
pub use components::HyperlinkStyle;
pub use components::LabelOutput;
pub use components::LinkActivation;
pub use components::LinkReport;
pub use components::LinkTarget;
pub use components::RichText;
pub use components::SelectableLabel;
pub use components::SelectionScope;
pub use components::Span;
pub use components::SpanStyle;
pub use components::Underline;
pub use components::UrlError;
pub use components::UrlPolicy;
pub use components::PanZoom;
pub use components::PanZoomOutput;
pub use components::PanZoomState;
pub use components::ZoomWheel;
pub use context::ActionSource;
pub use context::ActionsHandle;
pub use context::CacheStats;
pub use context::ClipboardBackend;
pub use context::ClipboardError;
pub use context::Context;
pub use context::DebugOverlay;
pub use context::Diagnostic;
pub use context::DiagnosticKind;
pub use context::EventResponse;
pub use context::FocusAxis;
pub use context::Id;
pub use context::ImeEvent;
pub use context::InputEvent;
pub use context::InputState;
pub use context::InputStats;
pub use context::KeyEvent;
pub use context::KeyInput;
pub use context::KeyInterest;
pub use context::PendingChord;
pub use context::SharedResources;
pub use context::WheelDelta;
pub use files::DialogBackend;
pub use files::DialogLaunch;
pub use files::DialogReply;
pub use files::DialogRequest;
pub use files::DialogResult;
pub use files::FileDialog;
pub use files::FileDialogKind;
pub use files::MemoryDialogs;
pub use files::SystemDialogs;
pub use files::FileError;
pub use files::FileFilter;
pub use files::FileTask;
pub use files::PickedFile;
pub use images::DecodedImage;
pub use images::ImageDecoder;
pub use images::ImageError;
pub use images::ImageHandle;
pub use images::ImageLimits;
pub use images::ImageMetrics;
pub use images::ImageSource;
pub use images::ImageStage;
pub use images::ImageState;
pub use images::ImageTiming;
pub use layout::Layout;
pub use layout::Padding;
pub use material::Material;
pub use material::MaterialError;
pub use material::MaterialErrorKind;
pub use material::ParamKind;
pub use material::ParamLayout;
pub use material::ParamValue;
pub use material::Params;
pub use material::FRAME_BYTES;
pub use material::MAX_MATERIALS;
pub use material::MAX_PARAM_BYTES;
pub use material::MAX_UNIFORM_BYTES;
pub use protocol::DrawCommand;
pub use protocol::DrawData;
pub use protocol::GeometryUpdate;
pub use protocol::MaterialDraw;
pub use protocol::MaterialId;
pub use protocol::MaterialSource;
pub use protocol::TextureFilter;
pub use protocol::TextureId;
pub use protocol::TextureImage;
pub use protocol::TextureOptions;
pub use protocol::Vertex;
pub use renderer::EmbedAlpha;
pub use renderer::EmbedColorSpace;
pub use renderer::EmbedError;
pub use renderer::EmbedLoad;
pub use renderer::EmbedOptions;
pub use renderer::EmbedViewport;
pub use renderer::EmbeddedRenderer;
pub use renderer::PhysicalRect;
pub use renderer::PresentationMode;
pub use renderer::RecordReport;
pub use renderer::RenderError;
pub use renderer::RenderStatus;
pub use renderer::Renderer;
pub use renderer::RendererStats;
pub use shapes::Border;
pub use shapes::Color;
pub use shapes::CornerRadius;
pub use shapes::Gradient;
pub use shapes::GradientDirection;
pub use shapes::Rect;
pub use shapes::RectShape;
pub use shapes::Shadow;
pub use shapes::Shape;
pub use shapes::Transform;
pub use z_icons as icons;
pub use accesskit;
pub use accesskit_winit;
pub use wgpu;
pub use winit;
pub use components::theme::*;

Modules§

accessibility
The accessibility layer: what each widget is, says and accepts, for screen readers and other assistive technology.
actions
Actions and keymap: commands declared once, shown and run from every place that offers them. See the actions page of the documentation.
animation
Time-based motion with retained channels, extensible curves and value types.
app
Desktop runner: one or several native windows, each with its own context and surface. The low-level Context and Renderer remain available for custom hosts.
components
Immediate mode components and the shared UI API.
context
Global UI state, winit input integration, repaint scheduling, and geometry cache.
files
Files that arrive from outside the application: dropped from the system’s file manager or chosen in a native dialog.
images
Built-in local image loading. All expensive work runs on bounded worker threads.
layout
Layout primitives. All UI distances are logical pixels (points).
material
Custom fragment shaders for widgets.
protocol
Public drawing protocol shared by UI producers and rendering backends.
renderer
wgpu backend with persistent buffers, texture versioning, and surface recovery.
shapes
Typed drawing primitives and CPU tessellation.
widgets
Compatibility re-exports. New components are defined in crate::components.

Macros§

impl_interpolate
Implement Interpolate for a struct by interpolating the named fields, each of which must itself implement Interpolate.
impl_spring_value
Implement SpringValue for a struct whose named fields are all SpringValues. The norm is the Euclidean norm of the field norms.

Structs§

FontFamily
A font family: the font files of one typeface, each declared for a weight.
FontWeight
A font weight on the CSS scale: 100 (thin) to 900 (black), 400 is regular.
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
MonospaceMetrics
Cell size of the monospace family at one size and weight, from the same layout that paints and measures monospace text.
Vec2
A 2-dimensional vector.

Enums§

TextFamily
The family a piece of text is shaped with. The two families are chosen independently of each other and of the weight.

Constants§

MAX_POPUP_DEPTH
How many popups can be open one inside another, root included. Opening a deeper one is refused with a diagnostic; nothing below it is dropped.

Functions§

vec2
Creates a 2-dimensional vector.