{"id":25882970,"url":"https://github.com/zabackary/vexide-slint","last_synced_at":"2025-03-02T16:30:15.103Z","repository":{"id":280119284,"uuid":"940637667","full_name":"zabackary/vexide-slint","owner":"zabackary","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-01T10:45:34.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T11:29:15.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zabackary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-28T14:28:09.000Z","updated_at":"2025-03-01T10:45:37.000Z","dependencies_parsed_at":"2025-03-01T11:40:27.998Z","dependency_job_id":null,"html_url":"https://github.com/zabackary/vexide-slint","commit_stats":null,"previous_names":["zabackary/vexide-slint"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabackary%2Fvexide-slint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabackary%2Fvexide-slint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabackary%2Fvexide-slint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zabackary%2Fvexide-slint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zabackary","download_url":"https://codeload.github.com/zabackary/vexide-slint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241536852,"owners_count":19978413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-02T16:30:14.351Z","updated_at":"2025-03-02T16:30:15.039Z","avatar_url":"https://github.com/zabackary.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slint for vexide\n\n\u003e [!WARNING]\n\u003e\n\u003e This repo has been moved to the `vexide` org.\n\nThis crate exists to allow for the use of Slint-based UIs in [vexide]. It\nprovides an implementation of the Slint `Platform` trait that uses the V5 brain\nto render the UI.\n\n[vexide]: https://vexide.dev\n\n## Usage\n\nTo use this crate, add it to your `Cargo.toml`:\n\n```toml\n[dependencies]\nslint-vexide = \"0.1.0\"\n```\n\nThen, you must call `slint_vexide::initialize_slint_platform()` before creating\nand running your Slint widget. This will set up Slint for software-rendering\nyour UI on the brain's display.\n\n# Example\n\n```rust\n// Include the modules generated by Slint for your UI files.\n// You will need to configure your `build.rs` to do this; see below.\nslint::include_modules!();\n\n#[vexide::main]\nasync fn main(peripherals: vexide::prelude::Peripherals) {\n    let robot = Robot {\n        // ...\n    };\n\n    // Since running the Slint UI is a blocking operation, we need to spawn the\n    // competition task as a separate task that will run concurrently.\n    // The Slint runtime internally polls all spawned futures.\n    vexide::task::spawn(robot.compete()).detach();\n\n    // Initialize the Slint platform with the V5 display-backed implementation.\n    vexide_slint::initialize_slint_platform(peripherals.display);\n    // Create and run the application. For more information on this, see the\n    // Slint documentation.\n    MyApplication::new()\n        .expect(\"Failed to create application\")\n        .run()\n        .expect(\"Failed to run application\");\n    // Since MyApplication::run() could return if the application is closed\n    // programmatically, we need to convince the compiler that the return type\n    // is `!` (never).\n    vexide::program::exit();\n}\n```\n\nYou'll need to compile your UI code separately from your main application code\nusing a custom build script. Add the `slint-build` crate to your `Cargo.toml`:\n\n```toml\n[build-dependencies]\nslint-build = \"0.1.0\"\n```\n\nThen, create a `build.rs` file in your project root with the following content:\n\n```rust\nfn main() {\n    // Compile the Slint UI file with the appropriate configuration.\n    slint_build::compile_with_config(\n        \"ui/YourFile.slint\", // Path to your Slint UI file.\n        slint_build::CompilerConfiguration::new()\n            // Make sure to enable this configuration flag.\n            .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer)\n            // Optionally, you can specify a style to use for the UI.\n            // Check the Slint documentation for more information.\n            .with_style(\"style-name\".into()),\n    )\n    .expect(\"Slint build failed\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzabackary%2Fvexide-slint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzabackary%2Fvexide-slint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzabackary%2Fvexide-slint/lists"}