Go to file
Samuel Guerra aa35e144ba Fixed tests. 2024-02-13 01:23:45 -03:00
.cargo Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
.vscode Refactored view-api to use Txt. 2023-11-28 17:04:32 -03:00
TODO More docs refactor. 2024-02-13 00:18:45 -03:00
examples More docs review. 2024-02-08 01:07:30 -03:00
tests More docs review. 2024-02-12 15:46:22 -03:00
tools Added view-process crates to main crate with non-default features. 2024-01-18 18:44:58 -03:00
zero-ui Fixed tests. 2024-02-13 01:23:45 -03:00
zero-ui-app More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-app-proc-macros Keep relative anchors in inherited docs that still point to an existing element ID. 2024-02-09 20:17:31 -03:00
zero-ui-app_context More docs review. 2024-02-08 01:07:30 -03:00
zero-ui-clone_move Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-color More docs review. 2024-02-09 12:10:40 -03:00
zero-ui-color-proc-macros Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-ext-clipboard More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-ext-config Config docs review. 2024-02-09 22:46:14 -03:00
zero-ui-ext-font Fixed tests. 2024-02-13 01:23:45 -03:00
zero-ui-ext-fs_watcher Implemented INSTANT and replaced all usages. 2024-02-02 15:36:44 -03:00
zero-ui-ext-image More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-ext-input More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-ext-l10n Documented how to localize commands. 2024-01-19 11:28:42 -03:00
zero-ui-ext-l10n-proc-macros Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-ext-undo Implemented INSTANT and replaced all usages. 2024-02-02 15:36:44 -03:00
zero-ui-ext-window More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-handle Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-l10n-scraper Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-layout Added missing angle operations. 2024-02-03 00:10:23 -03:00
zero-ui-state_map Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-task Optimized `wait_deadline`. 2024-02-04 01:30:30 -03:00
zero-ui-task-proc-macros Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-time More docs review. 2024-02-08 01:07:30 -03:00
zero-ui-txt Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-unique_id More docs review. 2024-02-08 01:07:30 -03:00
zero-ui-unit Implemented INSTANT and replaced all usages. 2024-02-02 15:36:44 -03:00
zero-ui-var More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-var-proc-macros Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-view More docs review. 2024-02-08 01:07:30 -03:00
zero-ui-view-api More docs review. 2024-02-09 12:10:40 -03:00
zero-ui-view-prebuilt Changed the prebuilt's `run_same_process` to exit the process upon `run_app` returning, to ensure that all threads are stopped. 2024-01-23 18:58:10 -03:00
zero-ui-wgt More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-wgt-access Doc review. 2024-02-07 18:41:33 -03:00
zero-ui-wgt-ansi_text Doc review. 2024-02-07 18:41:33 -03:00
zero-ui-wgt-button Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-checkerboard More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-wgt-container Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-data More docs review. 2024-02-12 15:46:22 -03:00
zero-ui-wgt-data_view More docs review. 2024-02-12 15:46:22 -03:00
zero-ui-wgt-fill More docs review. 2024-02-09 12:10:40 -03:00
zero-ui-wgt-filter Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-grid Removed fake examples. 2024-01-31 20:46:52 -03:00
zero-ui-wgt-image More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-wgt-input More docs. 2024-02-12 17:59:00 -03:00
zero-ui-wgt-inspector Config docs review. 2024-02-09 22:46:14 -03:00
zero-ui-wgt-layer More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-wgt-link Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-markdown More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-wgt-material-icons Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-menu Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-panel Fixed `is_disabled` when widget is reinited. 2024-01-22 18:18:28 -03:00
zero-ui-wgt-rule_line Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-scroll More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-wgt-size_offset Fixed max_size in fill context. 2024-01-24 13:20:39 -03:00
zero-ui-wgt-stack Removed fake examples. 2024-01-31 20:46:52 -03:00
zero-ui-wgt-style More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-wgt-text Updated HYPHENATION service pattern. 2024-02-12 21:29:42 -03:00
zero-ui-wgt-text_input Adjusted default spacing of FieldStyle to better clear the adorners. 2024-01-27 01:36:51 -03:00
zero-ui-wgt-toggle Added toggle docs. 2024-01-22 23:26:18 -03:00
zero-ui-wgt-tooltip Implemented INSTANT and replaced all usages. 2024-02-02 15:36:44 -03:00
zero-ui-wgt-transform Used `include_str!` to add the README.md to the main page documentation of each component crate. 2024-01-17 19:10:56 -03:00
zero-ui-wgt-undo Implemented INSTANT and replaced all usages. 2024-02-02 15:36:44 -03:00
zero-ui-wgt-undo_history More docs review. 2024-02-08 23:13:56 -03:00
zero-ui-wgt-window Config docs review. 2024-02-09 22:46:14 -03:00
zero-ui-wgt-wrap Added commit_data calls to other panels. 2024-01-25 10:34:57 -03:00
.gitattributes More EOF fixes. 2021-09-06 15:22:40 -03:00
.gitignore Added video recording to headless example. 2024-02-03 12:54:00 -03:00
.gitmodules Changed webrender to be linked directly from git again. 2023-07-13 15:35:44 -03:00
CHANGELOG.md * Added LICENSE and CHANGELOG. 2021-07-29 18:46:39 -03:00
Cargo.toml Tested and fixed prebuild only build. 2024-02-07 12:22:58 -03:00
LICENSE * Added LICENSE and CHANGELOG. 2021-07-29 18:46:39 -03:00
README.md Added system requirements to main README. 2024-02-05 11:07:25 -03:00
do Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
do.bat Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
do.ps1 Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
rustfmt.toml Fixed format of dump.rs with "async move" block. 2022-06-07 11:42:29 -03:00

README.md

License Crates.io docs.rs

zero-ui

Zero-Ui is the pure Rust UI framework with batteries included it provides all that you need to create beautiful, fast and responsive multi-platform apps. Ready made highly customizable widgets, automatic focus and accessibility management, responsive layout, data binding, easy localization and async tasks.

Usage

First add this to your Cargo.toml:

[dependencies]
zero-ui = { version = "0.1", features = ["view_prebuilt"] }

Then create your first window:

use zero_ui::prelude::*;

fn main() {
    zero_ui::view_process::prebuilt::init();
    APP.defaults().run_window(async {
        let size = var(layout::Size::new(800, 600));
        Window! {
            title = size.map(|s| formatx!("Button Example - {s}"));
            size;
            child_align = Align::CENTER;
            child = Button! {
                on_click = hn!(|_| {
                    println!("Button clicked!");
                });
                text::font_size = 28;
                child = Text!("Click Me!");
            }
        }
    })
}

See the API docs for more details.

Cargo Features

Zero-Ui provides the following features which can be enabled in your Cargo.toml file:

  • view — Include the default view-process implementation.
  • view_prebuilt — Include the default view-process implementation as an embedded precompiled binary.
  • inspector — Instrument each property and widget instance with inspector nodes and extend windows to be inspected on Ctrl+Shift+I.
  • trace_widget — Instrument every widget outer-most node to trace UI methods.
  • trace_wgt_item — Instrument every property and intrinsic node to trace UI methods.
  • deadlock_detection — Spawns a thread on app creation that checks and prints parking_lot deadlocks.
  • http — Enables HTTP tasks, images download.
  • test_util — Test utilities.
  • multi_app — Allows multiple app instances per-process, one app per thread at a time. The LocalContext tracks what app is currently running in each thread and app_local! statics switch to the value of each app depending on the current thread.
  • hyphenation_embed_all — Embed hyphenation dictionaries for all supported languages. If enabled some 2.8MB of data is embedded, you can provide an alternative dictionary source using the Hyphenation::dictionary_source method.
  • dyn_node — Use more dynamic dispatch at the node level by enabling UiNode::cfg_boxed to box.
  • dyn_app_extension — Use dynamic dispatch at the app-extension level.
  • dyn_closure — Box closures at opportune places, such as Var::map, reducing the number of monomorphised types.
  • toml — Enable TOML configs.
  • ron — Enable RON configs.
  • yaml — Enable YAML configs.
  • material_icons — Include all Material Icons icon sets, each icon set embeds some 300KB of data.
  • material_icons_outlined Include Material Icons Outlined icon set. If enabled some icons of this set are used for some of the commands.
  • material_icons_filled Include Material Icons Filled icon set.
  • material_icons_rounded Include Material Icons Rounded icon set.
  • material_icons_sharp Include Material Icons Sharp icon set.

These features are enabled by default:

  • debug_default — Enable the dyn_* and inspector features for debug builds only.
  • ipc — Enables pre-build views and connecting to views running in another process.
  • view_software — Enables software renderer fallback in the default view-process ("view").

Requirements

On Windows:

  • To build with "view" and "view_software" feature:
    • Env vars CC and CXX must be set to "clang-cl".
    • You can install clang using the Visual Studio installer or by installing LLVM directly.

on Linux:

  • Packages need to build:

    • pkg-config
    • libfontconfig1-dev
  • Packages need to build with "http" feature:

    • libssl-dev

cargo do

There is a built-in task runner for managing this project, run cargo do help or ./do help for details.

The task runner is implemented as a Rust crate in tools/do-tasks and an alias in .cargo/config.toml, it builds the tool silently in the first run, after it should run without noticeable delay.

Shell script to run do are also provided:

  • cmd.exe: do help.
  • PowerShell: ./do.ps1 help.
  • Bash: /.do help.

cargo do install

The task runner depends on multiple cargo commands, you can run cargo do install to see a list of all required commands and run cargo do install --accept to run the installation commands.

VSCode & Rust Analyzer

Some workspace settings are included in the repository, in particular, rust-analyzer "checkOnSave" and runnables are redirected to the do tool.