Go to file
Samuel Guerra 7af0065a9b Fixed tests. 2023-12-30 22:56:22 -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 Fixed tests. 2023-12-30 22:56:22 -03:00
examples Improved command window scope. Command properties set on the window root widget now automatically also handles the window scope. 2023-12-24 15:37:17 -03:00
tests Fixed tests. 2023-12-30 22:56:22 -03:00
tools App crate refactor. 2023-12-04 15:10:19 -03:00
zero-ui Refactored resolve_text and layout_text into separate functions that all use the new RwLock contexts. 2023-12-30 20:16:22 -03:00
zero-ui-app Continued implementing interactive caret hotspot. 2023-12-29 19:07:20 -03:00
zero-ui-app-proc-macros Renamed units to unit. 2023-12-16 11:52:46 -03:00
zero-ui-app_context Refactored resolve_text and layout_text into separate functions that all use the new RwLock contexts. 2023-12-30 20:16:22 -03:00
zero-ui-clone_move Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-color Fixed doc links. 2023-12-29 16:50:14 -03:00
zero-ui-color-proc-macros Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-ext-clipboard More main docs. 2023-12-23 22:13:06 -03:00
zero-ui-ext-config Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-ext-font Refactored resolve_text and layout_text into separate functions that all use the new RwLock contexts. 2023-12-30 20:16:22 -03:00
zero-ui-ext-fs_watcher Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-ext-image Implemented open image example and some general improvements. 2023-12-21 22:53:26 -03:00
zero-ui-ext-input Continued implementing interactive caret hotspot. 2023-12-29 19:07:20 -03:00
zero-ui-ext-l10n Fixed RTL and bidi selection. 2023-12-28 18:40:10 -03:00
zero-ui-ext-l10n-proc-macros Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-ext-undo Renamed `instance` and `nodes` to `node`, renamed `commands` to `cmd`. 2023-12-15 22:11:38 -03:00
zero-ui-ext-window Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-handle Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-l10n-scraper Implementing main re-exports. 2023-12-11 11:40:28 -03:00
zero-ui-layout Renamed units to unit. 2023-12-16 11:52:46 -03:00
zero-ui-state_map Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-task Renamed units to unit. 2023-12-16 11:52:46 -03:00
zero-ui-task-proc-macros Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-txt Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-unique_id Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-unit Renamed units to unit. 2023-12-16 11:52:46 -03:00
zero-ui-var Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-var-proc-macros Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-view Fixed native file dialog filter `"*"` not showing any file. 2023-12-27 16:48:32 -03:00
zero-ui-view-api Implemented open image example and some general improvements. 2023-12-21 22:53:26 -03:00
zero-ui-view-prebuilt Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt Fixed inspector cursor. 2023-12-27 00:33:52 -03:00
zero-ui-wgt-access Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-ansi_text Implemented `UiNode::is_nil` and `WidgetFn::call_checked`. 2023-12-20 18:52:15 -03:00
zero-ui-wgt-button Renamed color::filters to color::filter. 2023-12-13 17:35:11 -03:00
zero-ui-wgt-checkerboard Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-container Renamed child_insert properties to be shorter. 2023-12-22 11:08:46 -03:00
zero-ui-wgt-data Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-fill Renamed `instance` and `nodes` to `node`, renamed `commands` to `cmd`. 2023-12-15 22:11:38 -03:00
zero-ui-wgt-filter Renamed color::filters to color::filter. 2023-12-13 17:35:11 -03:00
zero-ui-wgt-grid Fixed grid layout when one dimension is "leftover" and the other is "default". 2023-12-27 00:01:12 -03:00
zero-ui-wgt-image Improved image load example. 2023-12-21 23:43:13 -03:00
zero-ui-wgt-input Fixed cursor showing for widget that is not allowed by the current pointer capture. 2023-12-29 17:33:52 -03:00
zero-ui-wgt-inspector Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-wgt-layer Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-wgt-link Renamed color::filters to color::filter. 2023-12-13 17:35:11 -03:00
zero-ui-wgt-markdown Implemented `UiNode::is_nil` and `WidgetFn::call_checked`. 2023-12-20 18:52:15 -03:00
zero-ui-wgt-material-icons Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-menu Renamed child_insert properties to be shorter. 2023-12-22 11:08:46 -03:00
zero-ui-wgt-panel Moved presenter nodes to -wgt crate. 2023-12-15 13:46:47 -03:00
zero-ui-wgt-rule_line Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-scroll Renamed units to unit. 2023-12-16 11:52:46 -03:00
zero-ui-wgt-size_offset Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-stack Replaced stack functions with `Stack!` shorthand. 2023-12-22 00:00:37 -03:00
zero-ui-wgt-style Added missing lints. 2023-12-10 23:26:30 -03:00
zero-ui-wgt-switch Moved switch to own crate. 2023-12-15 01:15:32 -03:00
zero-ui-wgt-text Refactored resolve_text and layout_text into separate functions that all use the new RwLock contexts. 2023-12-30 20:16:22 -03:00
zero-ui-wgt-text_input Implemented `is_touch` in `SelectionToolbarArgs` and changed the default selection toolbar to only open on touch interactions. 2023-12-21 18:49:21 -03:00
zero-ui-wgt-toggle Renamed child_insert properties to be shorter. 2023-12-22 11:08:46 -03:00
zero-ui-wgt-tooltip Moved presenter nodes to -wgt crate. 2023-12-15 13:46:47 -03:00
zero-ui-wgt-transform Added some modules to `prelude::*`. 2023-12-15 18:20:31 -03:00
zero-ui-wgt-undo Implementing main re-exports. 2023-12-11 11:40:28 -03:00
zero-ui-wgt-undo_history Implemented strong typed var hook. 2023-12-27 11:38:30 -03:00
zero-ui-wgt-view Moved presenter nodes to -wgt crate. 2023-12-15 13:46:47 -03:00
zero-ui-wgt-window Renamed `instance` and `nodes` to `node`, renamed `commands` to `cmd`. 2023-12-15 22:11:38 -03:00
zero-ui-wgt-wrap Renamed units to unit. 2023-12-16 11:52:46 -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 Renamed units to unit. 2023-12-16 11:52:46 -03:00
LICENSE * Added LICENSE and CHANGELOG. 2021-07-29 18:46:39 -03:00
README.md Add missing view init on main doc example. 2023-12-17 02:04:29 -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"
zero-ui-view = "0.1"

Then create your first window:

use zero_ui::prelude::*;

fn main() {
    zero_ui_view::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 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.