About
Iced Spatial Navigation is an unofficial extension to the Iced UI framework. It is designed to bring easy remote or gamepad navigation to any TV/console style app.
Features
It is also designed to scale well with any display, completely lossless.
It should be able to handle any vertical button grid you can throw at it, with scrolling and all.
Fair warning, though: it cannot handle typical horizontal scrolling without slight code modification.
Why did I make this?
I was wanting to make a Linux smart TV distro, but no matter which one I went to, at least for Plasma 6, Plasma Bigscreen wasn't available.
And Kodi smart TV projects were already available (such as LibreELEC).
SteamOS can do something similar, but it's more clunky and made for, you know, gaming.
So, I figured, why not try something like this?
I'd learnt a fair bit in the process anyway, so even if this amounts to nothing on my end, it didn't really go to waste.
Setup
In order to set up Iced Spatial Navigation in your project, simply type:
Or, in your Cargo.toml file:
iced_spatial_navigation = { git = "https://github.com/JaydonXOneGitHub/iced_spatial_navigation", branch = "master" }
Use in Iced application
Set it up in a few easy steps.
In main, you can keep it as-is:
However, here's where it's probably going to get a little weird.
In main.rs, or another file, make a custom enum:
Make sure to implement Clone for it, too, though.
Similarly, define a GridButton struct that implements TGridButton:
Then, use this as the initialize function:
Or this:
update and view should look something like this:
As for subscription:
And I do believe that's everything needed done to set it up.
Notice
If you find problems with the library, fork it.
I trust that you'll be able to do well and fix the issues. 😊