Go to file
Samuel Guerra bfdb1a242e More var docs and changes. 2024-01-30 11:47:24 -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 var docs and changes. 2024-01-30 11:47:24 -03:00
examples More var docs and changes. 2024-01-30 11:47:24 -03:00
tests Added wrap docs. 2024-01-26 12:35:12 -03:00
tools Added view-process crates to main crate with non-default features. 2024-01-18 18:44:58 -03:00
zero-ui More var docs and changes. 2024-01-30 11:47:24 -03:00
zero-ui-app Renamed `View!` to `DataView!` and documented it. 2024-01-25 16:59:13 -03:00
zero-ui-app-proc-macros Fixed widget fetch across crates. 2024-01-27 00:31:52 -03:00
zero-ui-app_context 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-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 Added some more layout documentation. 2024-01-20 15:08:05 -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 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-config 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-font Fixed doc tests. 2024-01-19 12:43:12 -03:00
zero-ui-ext-fs_watcher 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-image Added image docs. 2024-01-18 16:40:19 -03:00
zero-ui-ext-input Fixed panic clicking an `EXIT_CMD` context menu button.. 2024-01-19 21:10:41 -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 Added undo docs. 2024-01-27 19:41:59 -03:00
zero-ui-ext-window 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-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 Cannot easly implement transition to Align::FILL. It represents a different path in layouts, constraints are different. 2024-01-29 23:20:49 -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 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-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-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 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-unit 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-var More var docs and changes. 2024-01-30 11:47:24 -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 Apply the downscale to the image size as soon as it is available. 2024-01-23 22:48:52 -03:00
zero-ui-view-api Apply the downscale to the image size as soon as it is available. 2024-01-23 22:48:52 -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 Changed PanelList data commit to work by requesting render for the panel widget only. 2024-01-24 20:57:39 -03:00
zero-ui-wgt-access 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-ansi_text 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-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 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-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 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_view Renamed `View!` to `DataView!` and documented it. 2024-01-25 16:59:13 -03:00
zero-ui-wgt-fill 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-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 Added commit_data calls to other panels. 2024-01-25 10:34:57 -03:00
zero-ui-wgt-image Fixed Image::on_load firing on init for the dummy image. 2024-01-23 15:10:47 -03:00
zero-ui-wgt-input 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-inspector Fixed exact size properties. 2024-01-22 00:47:54 -03:00
zero-ui-wgt-layer Added layer docs. 2024-01-19 16:12:27 -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 Fixed markdown list item with block children. 2024-01-19 19:00:37 -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 Fixed Image::on_load firing on init for the dummy image. 2024-01-23 15:10:47 -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 Fixed stack direction transition with align. 2024-01-29 23:07:33 -03:00
zero-ui-wgt-style 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-text Added text docs and reorganized some text properties. 2024-01-26 17:56:02 -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 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-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 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_history 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-window 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-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 Ignore Zdump-mono-stats. 2024-01-02 11:47:42 -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 Renamed `View!` to `DataView!` and documented it. 2024-01-25 16:59:13 -03:00
LICENSE * Added LICENSE and CHANGELOG. 2021-07-29 18:46:39 -03:00
README.md Documented the main loop. 2024-01-29 14:48:15 -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
git-dependencies.md Changed webrender to be linked directly from git again. 2023-07-13 15:35:44 -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").

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.