e092792ff6
The recent change of `Var::wait_update` to an async method caused it to not instantiate the future at the moment the method is called, so the code that double checks if the response is done in `wait_done` no longer covered all conditions. |
||
---|---|---|
.cargo | ||
.vscode | ||
TODO | ||
examples | ||
tests | ||
tools | ||
zero-ui | ||
zero-ui-app | ||
zero-ui-app-proc-macros | ||
zero-ui-app_context | ||
zero-ui-clone_move | ||
zero-ui-color | ||
zero-ui-color-proc-macros | ||
zero-ui-ext-clipboard | ||
zero-ui-ext-config | ||
zero-ui-ext-font | ||
zero-ui-ext-fs_watcher | ||
zero-ui-ext-image | ||
zero-ui-ext-input | ||
zero-ui-ext-l10n | ||
zero-ui-ext-l10n-proc-macros | ||
zero-ui-ext-undo | ||
zero-ui-ext-window | ||
zero-ui-handle | ||
zero-ui-l10n-scraper | ||
zero-ui-layout | ||
zero-ui-state_map | ||
zero-ui-task | ||
zero-ui-task-proc-macros | ||
zero-ui-txt | ||
zero-ui-unique_id | ||
zero-ui-unit | ||
zero-ui-var | ||
zero-ui-var-proc-macros | ||
zero-ui-view | ||
zero-ui-view-api | ||
zero-ui-view-prebuilt | ||
zero-ui-wgt | ||
zero-ui-wgt-access | ||
zero-ui-wgt-ansi_text | ||
zero-ui-wgt-button | ||
zero-ui-wgt-checkerboard | ||
zero-ui-wgt-container | ||
zero-ui-wgt-data | ||
zero-ui-wgt-fill | ||
zero-ui-wgt-filter | ||
zero-ui-wgt-grid | ||
zero-ui-wgt-image | ||
zero-ui-wgt-input | ||
zero-ui-wgt-inspector | ||
zero-ui-wgt-layer | ||
zero-ui-wgt-link | ||
zero-ui-wgt-markdown | ||
zero-ui-wgt-material-icons | ||
zero-ui-wgt-menu | ||
zero-ui-wgt-panel | ||
zero-ui-wgt-rule_line | ||
zero-ui-wgt-scroll | ||
zero-ui-wgt-size_offset | ||
zero-ui-wgt-stack | ||
zero-ui-wgt-style | ||
zero-ui-wgt-switch | ||
zero-ui-wgt-text | ||
zero-ui-wgt-text_input | ||
zero-ui-wgt-toggle | ||
zero-ui-wgt-tooltip | ||
zero-ui-wgt-transform | ||
zero-ui-wgt-undo | ||
zero-ui-wgt-undo_history | ||
zero-ui-wgt-view | ||
zero-ui-wgt-window | ||
zero-ui-wgt-wrap | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
CHANGELOG.md | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
do | ||
do.bat | ||
do.ps1 | ||
git-dependencies.md | ||
rustfmt.toml |
README.md
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 = "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.
Cargo Features
Zero-Ui provides the following features which can be enabled in your Cargo.toml
file:
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 printsparking_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. TheLocalContext
tracks what app is currently running in each thread andapp_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 theHyphenation::dictionary_source
method.dyn_node
— Use more dynamic dispatch at the node level by enablingUiNode::cfg_boxed
to box.dyn_app_extension
— Use dynamic dispatch at the app-extension level.dyn_closure
— Box closures at opportune places, such asVar::map
, reducing the number of monomorphised types.toml
— Enable TOML configs.ron
— Enable RON configs.yaml
— Enable YAML configs.
These features are enabled by default:
debug_default
— Enable thedyn_*
andinspector
features for debug builds only.ipc
— Enables pre-build views and connecting to views running in another process.material_icons
— Include material icons in the default app.
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.