Updated README and Cargo.toml

Also removed example that wasn't ever completed.
This commit is contained in:
Jonathan Johnson 2023-12-18 09:55:42 -08:00
parent 02d6b343f1
commit 4a68fa08f8
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
4 changed files with 147 additions and 65 deletions

139
Cargo.lock generated
View file

@ -214,6 +214,12 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bit_field"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
[[package]]
name = "bitflags"
version = "1.3.2"
@ -496,6 +502,29 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751"
dependencies = [
"cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa"
dependencies = [
"autocfg",
"cfg-if",
"crossbeam-utils",
"memoffset 0.9.0",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.17"
@ -505,6 +534,12 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crunchy"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "cursor-icon"
version = "1.1.0"
@ -554,6 +589,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]]
name = "either"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "encode_unicode"
version = "0.3.6"
@ -605,6 +646,22 @@ dependencies = [
"num-traits",
]
[[package]]
name = "exr"
version = "1.71.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8"
dependencies = [
"bit_field",
"flume",
"half",
"lebe",
"miniz_oxide",
"rayon-core",
"smallvec",
"zune-inflate",
]
[[package]]
name = "fast-srgb8"
version = "1.0.0"
@ -760,6 +817,16 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "gif"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045"
dependencies = [
"color_quant",
"weezl",
]
[[package]]
name = "gimli"
version = "0.28.1"
@ -806,6 +873,7 @@ dependencies = [
"alot",
"arboard",
"gooey-macros",
"image",
"intentional",
"interner",
"kempt",
@ -886,6 +954,15 @@ dependencies = [
"bitflags 2.4.1",
]
[[package]]
name = "half"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0"
dependencies = [
"crunchy",
]
[[package]]
name = "hashbrown"
version = "0.14.3"
@ -937,9 +1014,13 @@ dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"exr",
"gif",
"jpeg-decoder",
"num-rational",
"num-traits",
"png",
"qoi",
"tiff",
]
@ -1020,6 +1101,9 @@ name = "jpeg-decoder"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"
dependencies = [
"rayon",
]
[[package]]
name = "js-sys"
@ -1087,6 +1171,12 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lebe"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
[[package]]
name = "libc"
version = "0.2.151"
@ -1287,6 +1377,15 @@ dependencies = [
"autocfg",
]
[[package]]
name = "memoffset"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
[[package]]
name = "metal"
version = "0.27.0"
@ -1381,7 +1480,7 @@ dependencies = [
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset",
"memoffset 0.7.1",
]
[[package]]
@ -1740,6 +1839,15 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1de09527cd2ea2c2d59fb6c2f8c1ab8c71709ed9d1b6d60b0e1c9fbb6fdcb33c"
[[package]]
name = "qoi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"
dependencies = [
"bytemuck",
]
[[package]]
name = "quick-xml"
version = "0.30.0"
@ -1835,6 +1943,26 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544"
[[package]]
name = "rayon"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
dependencies = [
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
@ -3138,3 +3266,12 @@ name = "zeroize"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
[[package]]
name = "zune-inflate"
version = "0.2.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"
dependencies = [
"simd-adler32",
]

View file

@ -4,6 +4,12 @@
name = "gooey"
version = "0.1.0"
edition = "2021"
description = "A wgpu-powered graphical user interface (GUI) library with a reactive data model"
repository = "https://github.com/khonsulabs/gooey"
license = "MIT OR Apache-2.0"
keywords = ["gui", "ui", "widgets", "reactive"]
categories = ["gui"]
readme = "./README.md"
[features]
default = ["tracing-output", "roboto-flex"]
@ -48,6 +54,7 @@ opt-level = 2
[dev-dependencies]
pollster = "0.3.0"
rand = "0.8.5"
image = { version = "0.24.7", features = ["png"] }
[profile.release]
debug = true

View file

@ -1,6 +1,6 @@
# Gooey
![Gooey is considered experimental and unsupported](https://img.shields.io/badge/status-prototype-blueviolet)
![Gooey is considered alpha and unsupported](https://img.shields.io/badge/status-alpha-blueviolet)
[![crate version](https://img.shields.io/crates/v/gooey.svg)](https://crates.io/crates/gooey)
[![Documentation for `main` branch](https://img.shields.io/badge/docs-main-informational)](https://gooey.rs/main/gooey/)
@ -50,7 +50,7 @@ creating an example.
## Project Status
This project is early in development, but is quickly becoming a decent
framework. It is considered experimental and unspported at this time, and the
framework. It is considered alpha and unsupported at this time, and the
primary focus for [@ecton][ecton] is to use this for his own projects. Feature
requests and bug fixes will be prioritized based on @ecton's own needs.

View file

@ -1,62 +0,0 @@
use gooey::value::Dynamic;
use gooey::widget::{Children, MakeWidget, WidgetInstance};
use gooey::widgets::input::InputValue;
use gooey::widgets::{Button, Label, Scroll, Stack};
use gooey::Run;
fn main() -> gooey::Result {
let tasks = Dynamic::default();
let children = Dynamic::default();
tasks
.for_each(children.with_clone(|children| {
move |tasks: &Vec<Task>| {
update_task_widgets(tasks, &mut children.lock());
}
}))
.persist();
let task_text = Dynamic::default();
let valid = task_text.map_each(|text: &String| !text.is_empty());
let task_form = Stack::columns(
task_text.clone().into_input().expand().and(
Button::new("Add Task")
.on_click(move |_| {
tasks.lock().push(Task::new(task_text.take()));
})
.into_default()
.with_enabled(valid),
),
);
let tasks = Scroll::vertical(Stack::rows(children));
Stack::rows(task_form.and(tasks)).expand().run()
}
struct Task {
widget: WidgetInstance,
}
impl Task {
pub fn new(text: String) -> Self {
let widget = Label::new(Dynamic::new(text)).align_left().make_widget();
Self { widget }
}
}
fn update_task_widgets(tasks: &[Task], children: &mut Children) {
'tasks: for (index, task) in tasks.iter().enumerate() {
for child in index..children.len() {
if children[child].id() == task.widget.id() {
if child != index {
children.swap(child, index);
}
continue 'tasks;
}
}
children.insert(index, task.widget.clone());
}
children.truncate(tasks.len());
}