Skip to content

Commit

Permalink
Merge pull request #73 from Leif-Rydenfalk/main
Browse files Browse the repository at this point in the history
Interactive UI Examples: Calculator, Synth + tiny event utils
  • Loading branch information
wtholliday authored Jan 23, 2025
2 parents 4555429 + 7db0850 commit 7f6b573
Show file tree
Hide file tree
Showing 30 changed files with 2,288 additions and 311 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[workspace]
resolver = "2" # What does this do?
members = [".", "./examples/flip_cards", "./examples/calculator", "./examples/synth"]
default-members = ["."]

[workspace.dependencies]
rui = { path = "." }

[package]
name = "rui"
Expand Down
20 changes: 20 additions & 0 deletions examples/any_view_modifier.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use rui::*;

trait MyMod {
fn my_modifier(self) -> AnyView;
}

impl MyMod for AnyView {
fn my_modifier(self) -> AnyView {
any_view(self.offset(LocalOffset::new(0.0, 100.0)))
}
}

fn my_text(name: &str) -> AnyView {
let name = name.to_string();
any_view(text(name.as_str()))
}

fn main() {
hstack((my_text("without"), my_text("with").my_modifier())).run();
}
243 changes: 0 additions & 243 deletions examples/calc.rs

This file was deleted.

10 changes: 10 additions & 0 deletions examples/calculator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "calculator"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
rui = { workspace = true }
palette = "0.7.6"
enterpolation = "0.2"
Loading

0 comments on commit 7f6b573

Please sign in to comment.