Free as in Freedom: Codeberg.org. Create your repos!
The Rust UI-Toolkit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Florian Blasius c12497b75b Add missing theme files to prelude. 1 week ago
.vscode [#166] move all code from window struct to window widget. 1 week ago
crates Add missing theme files to prelude. 1 week ago
examples [#166] move theme to window widget. 1 week ago
res Refactor wiget container and context. Implement switch widget. Image. 5 months ago
src [#166] move theme to window widget. 1 week ago
.gitignore Gitignore update. 4 months ago
.gitlab-ci.yml [api update] refactoring, fixes, scrollviewer, 2 months ago
CHANGELOG.md Update CHANGELOG.md 5 months ago
Cargo.lock Move theme resources to sub crate. 1 week ago
Cargo.toml [#166] move all code from window struct to window widget. 1 week ago
LICENSE Add first rev of orbtk 3 years ago
README.md [#166] move all code from window struct to window widget. 1 week ago

README.md

OrbTk

Build status MIT licensed crates.io docs.rs

OrbTk 0.3.0 is under heavy development and it’s not compatible to earlier releases.

The Orbital Widget Toolkit is a multi platform (G)UI toolkit for building scalable user interfaces with the programming language Rust. It’s based on the Entity Component System Pattern and provides a functional-reactive like API.

The main goals of OrbTk are fast performance, easy to use and cross platform.

Calculator

Features:

  • Modern lightweight API
  • Uses the Entity Component System library DCES for widget and properties handling
  • Updating instead of rebuilding sub-trees
  • Flexible event system
  • Widget state management
  • Cross platform: Redox OS, Linux, macOS, Windows
  • CSS theming

Usage

To include OrbTk in your project, just add the dependency line to your Cargo.toml file:

orbtk = "0.2.27"

To use OrbTk 0.3, just add the dependency line to your Cargo.toml file:

orbtk = { git = "https://gitlab.redox-os.org/redox-os/orbtk.git" }

However you also need to have the SDL2 libraries installed on your system. The best way to do this is documented by the SDL2 crate.

Use OrbTk with cairo

If you want to use OrbTk with cairo (recommanded) you have to install cairo graphics. Otherwise you have to build OrbTk with the “plain” feature.

  • With Ubuntu, please to type sudo apt-get install libcairo2-dev in your console.
  • With macOS and homebrew, please to type brew install cairo in your console.
  • With macOS and macports, please to type sudo port install cairo in your console.

Minimal Example

use orbtk::prelude::*;

fn main() {
      Application::new()
        .window(|ctx| {
            Window::create()
                .title("OrbTk - minimal example")
                .position((100.0, 100.0))
                .size(420.0, 730.0)
                .child(TextBlock::create().text("OrbTk").build(ctx))
                .build(ctx)
        })
        .run();
}

Additional Examples

You find the examples in the examples/ directory.

You can start the widgets example by executing the following command:

cargo run --example widgets --release

Build and run documentation

You can build and run the latest documentation y executing the following command:

cargo doc --no-deps --open

Planned features

  • Style guide
  • More default widgets
  • More examples
  • Book
  • Animations
  • Exchange views / widgets / screens on runtime
  • Split application in modules
  • Theme update
  • Support for Android, iOS, Ubuntu Touch and WebAssembly
  • Vulkan / OpenGL Support

Dependencies

Inspirations