Go to file
Samuel Guerra cf71cf0279 Finished overscroll indiciator. 2023-09-08 14:41:29 -03:00
.cargo Refactored do to be a cargo alias. 2021-11-09 20:18:21 -03:00
.vscode Updated dependencies. 2023-08-16 23:55:41 -03:00
TODO Finished overscroll indiciator. 2023-09-08 14:41:29 -03:00
examples Improved transform hovered animations. 2023-09-06 16:55:55 -03:00
tests Added some basic touch events. 2023-08-28 18:29:49 -03:00
tools Fixed warnings after Rust update. 2023-07-13 12:55:16 -03:00
zero-ui Finished overscroll indiciator. 2023-09-08 14:41:29 -03:00
zero-ui-core Finished overscroll indiciator. 2023-09-08 14:41:29 -03:00
zero-ui-l10n-scraper Fixed parsing of file/id.attr and some tests. 2023-05-26 16:47:07 -03:00
zero-ui-material-icons Fixed MaterialIcon display. 2023-08-19 00:58:40 -03:00
zero-ui-proc-macros Rust 1.72 lint fixes and build test update. 2023-08-24 14:03:07 -03:00
zero-ui-view Supress releated touch move events that don't move. 2023-09-05 00:15:31 -03:00
zero-ui-view-api Added exclusive video mode selection in window example. 2023-09-03 16:04:52 -03:00
zero-ui-view-prebuilt Changed prebuild installed DLLs to install in %temp%. 2023-08-09 23:16:23 -03:00
.gitattributes More EOF fixes. 2021-09-06 15:22:40 -03:00
.gitignore Create new "profile" folder for profiling test code. 2022-05-02 15:44:43 -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 Rust 1.72 lint fixes and build test update. 2023-08-24 14:03:07 -03:00
LICENSE * Added LICENSE and CHANGELOG. 2021-07-29 18:46:39 -03:00
README.md More refactor. 2023-04-12 15:42:03 -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 GUI framework with batteries included.

It provides all that you need to create a beautiful, fast and responsive multi-platform GUI apps, it includes many features that allow you to get started quickly, without sacrificing customization or performance. With features like gesture events, common widgets, layouts, data binding, async tasks, accessibility and localization you can focus on what makes your app unique, not the boilerplate required to get modern apps up to standard.

When you do need to customize, Zero-Ui is rightly flexible, you can create new widgets or customize existing ones, not just new looks but new behavior, at a lower level you can introduce new event types or new event sources, making custom hardware seamless integrate into the framework.

Usage

First add this to your Cargo.toml:

[dependencies]
zero-ui = "0.1"

Then create your first window:

use zero_ui::prelude::*;

fn run() {
    App::default().run_window(async {
        let size = var_from((800, 600));
        Window! {
            title = size.map(|s: &Size| formatx!("Button Example - {}", s));
            size;
            child = Button! {
                on_click = hn!(|_| {
                    println!("Button clicked!");
                });
                margin = 10;
                size = (300, 200);
                align = Align::CENTER;
                font_size = 28;
                child = Text!("Click Me!");
            }
        }
    })
}

See the API docs front page for more details.

Dependencies

Extra system dependencies needed for building a crate that uses the zero-ui crate.

Windows

You just need the latest stable Rust toolchain installed.

Linux

  • Latest stable Rust.
  • build-essential or equivalent C/C++ compiler package.
  • cmake
  • pkg-config
  • libssl-dev
  • libfreetype6-dev
  • libfontconfig1-dev

Linux support is tested using the Windows Subsystem for Linux (Ubuntu image).

Other Dependencies

For debugging this project you may also need cargo-expand and the nightly toolchain for debugging macros (do expand), cargo-asm for checking optimization (do asm).

You also need the nightly toolchain for building the documentation (do doc), although you can build the documentation in stable using cargo doc, but custom pages like widget items may not render properly because of changes in the cargo-doc HTML templates.

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.

VSCode & Rust Analyzer

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