Skip to content

Commit 7f6b573

Browse files
authored
Merge pull request #73 from Leif-Rydenfalk/main
Interactive UI Examples: Calculator, Synth + tiny event utils
2 parents 4555429 + 7db0850 commit 7f6b573

30 files changed

+2288
-311
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
[workspace]
22
resolver = "2" # What does this do?
3+
members = [".", "./examples/flip_cards", "./examples/calculator", "./examples/synth"]
4+
default-members = ["."]
5+
6+
[workspace.dependencies]
7+
rui = { path = "." }
38

49
[package]
510
name = "rui"

examples/any_view_modifier.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use rui::*;
2+
3+
trait MyMod {
4+
fn my_modifier(self) -> AnyView;
5+
}
6+
7+
impl MyMod for AnyView {
8+
fn my_modifier(self) -> AnyView {
9+
any_view(self.offset(LocalOffset::new(0.0, 100.0)))
10+
}
11+
}
12+
13+
fn my_text(name: &str) -> AnyView {
14+
let name = name.to_string();
15+
any_view(text(name.as_str()))
16+
}
17+
18+
fn main() {
19+
hstack((my_text("without"), my_text("with").my_modifier())).run();
20+
}

examples/calc.rs

Lines changed: 0 additions & 243 deletions
This file was deleted.

examples/calculator/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "calculator"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
rui = { workspace = true }
9+
palette = "0.7.6"
10+
enterpolation = "0.2"

0 commit comments

Comments
 (0)