No description
Find a file
Jonathan Johnson 2201f2c83b
Ranged sliders, advance_focus, allow_blur
Closes #60

Stepping in sliders is a compromise due to the flexibility of the
current slider implementation. I don't want to force types to implement
Add, and I don't like forcing types to require a Step (ie, what's the
appropriate value for f32 to specify as its next value?). Using a
percentage combined with lerp keeps the implementation fairly
straightfoward, although I remember experiencing this type of
configuration in another UI framework a long time ago and thinking it
was a little annoying to work with.

Ultimately, setting actual step boundaries can be done by customizing
the type that the slider is operating over. I feel like that's a much
more powerful design than I've experienced in previous frameworks, so
I'm hoping this percent step behavior is a reasonable compromise.
2023-11-20 19:44:03 -08:00
.github/workflows Adding CI 2023-11-02 10:46:43 -07:00
.rustme Helpers galore 2023-11-14 09:31:56 -08:00
assets Component type safety, some font support 2023-11-19 21:52:45 -08:00
examples Ranged sliders, advance_focus, allow_blur 2023-11-20 19:44:03 -08:00
gooey-macros derive(LinearInterpolate) on enum 2023-11-14 20:03:30 +01:00
src Ranged sliders, advance_focus, allow_blur 2023-11-20 19:44:03 -08:00
.crate-docs.md Removing centered from readme example 2023-11-14 20:41:04 -08:00
.gitignore Initial commit 2023-10-18 08:22:41 -07:00
Cargo.lock Ranged sliders, advance_focus, allow_blur 2023-11-20 19:44:03 -08:00
Cargo.toml Component type safety, some font support 2023-11-19 21:52:45 -08:00
CODE_OF_CONDUCT.md Resize/Expand rework + basic readme 2023-11-02 14:23:36 -07:00
CONTRIBUTING.md Resize/Expand rework + basic readme 2023-11-02 14:23:36 -07:00
LICENSE-APACHE Resize/Expand rework + basic readme 2023-11-02 14:23:36 -07:00
LICENSE-MIT Resize/Expand rework + basic readme 2023-11-02 14:23:36 -07:00
README.md Removing centered from readme example 2023-11-14 20:41:04 -08:00
rustfmt.toml Initial commit 2023-10-18 08:22:41 -07:00

Gooey

Gooey is considered experimental and unsupported crate version Documentation for main branch

Gooey is an experimental Graphical User Interface (GUI) crate for the Rust programming language. It is built using Kludgine, which is powered by winit and wgpu. It is incredibly early in development, and is being developed for a game that will hopefully be developed shortly.

The Widget trait is the building block of Gooey: Every user interface element implements Widget. A full list of built-in widgets can be found in the gooey::widgets module.

Gooey uses a reactive data model. To see an example of how reactive data models work, consider this example that displays a button that increments its own label:

fn main() -> gooey::Result {
    // Create a dynamic usize.
    let count = Dynamic::new(0_isize);
    // Create a dynamic that contains `count.to_string()`
    let count_label = count.map_each(ToString::to_string);

    // Create a new button whose text is our dynamic string.
    count_label
        .into_button()
        // Set the `on_click` callback to a closure that increments the counter.
        .on_click(count.with_clone(|count| move |_| count.set(count.get() + 1)))
        // Run the application
        .run()
}

Open-source Licenses

This project, like all projects from Khonsu Labs, is open-source. This repository is available under the MIT License or the Apache License 2.0.

To learn more about contributing, please see CONTRIBUTING.md.