Go to file
Samuel Guerra 9f00c221f1 Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
.cargo Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
.vscode More docs review. 2024-02-13 12:49:44 -03:00
TODO Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
examples Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
tests Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
tools Added view-process crates to main crate with non-default features. 2024-01-18 18:44:58 -03:00
zero-ui Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
zero-ui-app Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
zero-ui-app-proc-macros More docs review. 2024-02-15 11:35:27 -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 display list refactor. 2024-02-21 13:01:53 -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 Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
zero-ui-ext-fs_watcher More docs review. 2024-02-13 12:49:44 -03:00
zero-ui-ext-image Removed ImageKey, now use ImageTextureId with implicit IdNamespace.. 2024-02-19 16:15:27 -03:00
zero-ui-ext-input More docs review. 2024-02-15 19:01:02 -03:00
zero-ui-ext-l10n More docs refactor. 2024-02-13 23:39:14 -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 More docs review. 2024-02-15 19:01:02 -03:00
zero-ui-ext-window Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -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 Moved angle units to units crate. 2024-02-17 11:40:52 -03:00
zero-ui-state_map More docs review. 2024-02-15 20:24:55 -03:00
zero-ui-task All tests pass. 2024-02-17 13:37:14 -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 More display list refactor. 2024-02-21 13:01:53 -03:00
zero-ui-var Removed webrender types from the text display item. 2024-02-20 22:58:23 -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 Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
zero-ui-view-api Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -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 Moved mix methods to own trait. 2024-02-20 14:12:44 -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 Started unifying Rgba. 2024-02-20 17:33:17 -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 Started unifying Rgba. 2024-02-20 17:33:17 -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 More docs review. 2024-02-13 16:59:43 -03:00
zero-ui-wgt-image More docs review. 2024-02-12 19:00:28 -03:00
zero-ui-wgt-input More docs review. 2024-02-15 14:33:01 -03:00
zero-ui-wgt-inspector Finished unifying Rgba. 2024-02-20 18:26:27 -03:00
zero-ui-wgt-layer More docs review. 2024-02-14 00:27:20 -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 More docs review. 2024-02-14 00:27:20 -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 Started unifying Rgba. 2024-02-20 17:33:17 -03:00
zero-ui-wgt-scroll Started unifying Rgba. 2024-02-20 17:33:17 -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 More docs review. 2024-02-14 13:16:40 -03:00
zero-ui-wgt-style Implemented `NonWidgetBase` for use in types that are not suposed to be used in the UI or have an `id`, like `Style!`. 2024-02-15 00:09:27 -03:00
zero-ui-wgt-text Removed webrender types from the text display item. 2024-02-20 22:58:23 -03:00
zero-ui-wgt-text_input Implemented `NonWidgetBase` for use in types that are not suposed to be used in the UI or have an `id`, like `Style!`. 2024-02-15 00:09:27 -03:00
zero-ui-wgt-toggle More docs review. 2024-02-15 11:35:27 -03:00
zero-ui-wgt-tooltip More docs review. 2024-02-15 11:35:27 -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-webrender-debug Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -03:00
zero-ui-wgt-window Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -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 Removed `webrender_api` from `zero_ui_view_api` API. 2024-02-21 19:09:44 -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.