-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c286b3
commit e3cc2b6
Showing
5 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
# Taitank Safe | ||
|
||
(In Progress) Rust binding of [tencent/taitank](https:://github.com/tencent/taitank) provides safe binding to the Taitank Layout Library. | ||
[![License](https://img.shields.io/badge/license-MIT%20License-blue.svg)](https://opensource.org/licenses/MIT) | ||
[![Package version](https://img.shields.io/crates/v/taitank-safe.svg)](https://crates.io/crates/taitank-safe) | ||
[![Workflow](https://github.com/rustq/taitank-safe/actions/workflows/CI.yml/badge.svg)](https://github.com/rustq/taitank-safe/actions) | ||
|
||
Rust binding of [tencent/taitank](https://github.com/tencent/taitank) provides safe binding to the layout library. | ||
|
||
## Usage | ||
|
||
```toml | ||
[dependencies] | ||
taitank_safe = "0.0.1" | ||
taitank_safe = "0.0.6" | ||
``` | ||
|
||
```rust | ||
use taitank_safe::*; | ||
|
||
let mut root = node_create(); | ||
|
||
set_width(&mut root, 100.0); | ||
set_height(&mut root, 100.0); | ||
|
||
let mut root_child0 = node_create(); | ||
set_flex_grow(&mut root_child0, 1.0); | ||
set_flex_basis(&mut root_child0, 50.0); | ||
insert_child(&mut root, &mut root_child0, 0); | ||
layout!(&mut root); | ||
``` | ||
|
||
let mut root_child1 = node_create(); | ||
set_flex_grow(&mut root_child1, 1.0); | ||
insert_child(&mut root, &mut root_child1, 1); | ||
## Development | ||
|
||
layout!(&mut root); | ||
``` | ||
```shell | ||
$ git clone [email protected]:rustq/taitank-safe.git | ||
``` | ||
|
||
```shell | ||
$ cd taitank-safe | ||
``` | ||
|
||
```shell | ||
$ cargo run --example demo | ||
``` | ||
|
||
|
||
## License | ||
|
||
[MIT](https://opensource.org/licenses/MIT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters