commit 6fae59285a799a8b4a69e6c8463557f8d23bc692 Author: aOK Date: Mon Dec 11 23:15:58 2023 +0300 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..48c3ca4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/dist/ +/target/ +/Cargo.lock diff --git a/.makepadignore b/.makepadignore new file mode 100644 index 0000000..1ebdc6d --- /dev/null +++ b/.makepadignore @@ -0,0 +1,3 @@ +/src +/public +/Cargo.toml \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..24d7cc6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e6d9d21 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "emmet.includeLanguages": { + "rust": "html" + } +} diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..20082c5 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "makepad-template" +version = "0.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[profile.small] +inherits = "release" +#debug = true +opt-level = 'z' # Optimize for size +lto = true # Enable link-time optimization +codegen-units = 1 # Reduce number of codegen units to increase optimizations +panic = 'abort' # Abort on panic +strip = true + +[profile.release] +opt-level = "s" +lto = true +codegen-units = 1 +panic = "abort" +strip = true + +[dependencies] +# makepad-widgets = { version = "0.6.0" } +makepad-widgets = { git = "https://github.com/makepad/makepad/", branch = "rik" } diff --git a/README.md b/README.md new file mode 100644 index 0000000..b85f4b2 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Makepad UI + +This template should help get you started developing with Makepad Rust UI. + +## Recommended IDE Setup + +[VS Code](https://code.visualstudio.com/) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer). + + +# Desktop in Debug Mode +cargo run + +# Desktop in Release Mode +cargo run --release + +# Desktop in small size +cargo run --profile=small + +# Android +cargo makepad android run --release + +# IOS Simulator +cargo makepad apple ios --org=my.test --app=makepad-template run-sim --release + +# IOS Device +cargo makepad apple ios --org-id=123456 --org=my.test --app=makepad-template run-device makepad-template --release + +# Cargo Check Builds +cargo makepad check install-toolchain +cargo makepad check all + +cargo makepad wasm install-toolchain +cargo makepad apple ios install-toolchain +cargo makepad android --abi=all install-toolchain \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..b739f60 --- /dev/null +++ b/index.html @@ -0,0 +1,34 @@ + + + + + + Makepad Template + + + + + + +
+
+ Loading.. +
+
+ + diff --git a/resources/makepad.png b/resources/makepad.png new file mode 100644 index 0000000..052f301 Binary files /dev/null and b/resources/makepad.png differ diff --git a/resources/makepad.svg b/resources/makepad.svg new file mode 100644 index 0000000..5a2c8ef --- /dev/null +++ b/resources/makepad.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/me.svg b/resources/me.svg new file mode 100644 index 0000000..f9508de --- /dev/null +++ b/resources/me.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/app.rs b/src/app.rs new file mode 100644 index 0000000..0675719 --- /dev/null +++ b/src/app.rs @@ -0,0 +1,96 @@ +use makepad_widgets::*; + +live_design!{ + import makepad_widgets::base::*; + import makepad_widgets::theme_desktop_dark::*; + + import crate::shared::styles::*; + + // LOGO_MAKEPAD = dep("crate://self/resources/makepad.png") + LOGO_MAKEPAD = dep("crate://self/resources/makepad.svg") + + + App = {{App}} { + + ui: { + show_bg: true + width: Fill, + height: Fill + + draw_bg: { + fn pixel(self) -> vec4 { + //return #000 + return mix(#7, #3, self.pos.y); + } + } + + body = { + + flow: Down, + spacing: 20, + align: { + x: 0.5, + y: 0.5 + }, + avatar = { + source: (LOGO_MAKEPAD), + // width: 300., height: 50. + } + button1 =