MVVM Rust UI Framework Library.
Core library of FUI MVVM UI Framework.
Macros for FUI UI Framework.
Standard controls for FUI UI Framework.
Media controls for FUI UI Framework.
Cross-platform windowing library focused on good desktop integration (dialogs, menus, tray icons etc.).
Application backend of FUI UI Framework.
Note! The visual aspect of the library is a subject to change. Margins are missing. You can also write your own styles and make it look completely different.
- cross-platform:
- Linux (x11 & wayland using Qt)
- Windows (using Qt)
- Android
- Wasm
- renderer agnostic:
-
OpenGL
backend
-
- native elements:
- multiple windows
- tray icons
- native popup windows
- fallback to simulated popup windows (rendered in parent window)
- accessibility:
- keyboard support
- AccessKit
- MVVM model with:
- properties,
- bindings,
- observable collections
- async support
-
ui!
macro for easier view creation - extensive styling (style can change behavior)
#![windows_subsystem = "windows"]
use fui_app::*;
use fui_controls::*;
use fui_core::*;
use fui_macros::ui;
use std::cell::RefCell;
use std::rc::Rc;
use typed_builder::TypedBuilder;
use typemap::TypeMap;
use winit::window::WindowBuilder;
struct MainViewModel {
pub counter: Property<i32>,
}
impl MainViewModel {
pub fn new() -> Rc<Self> {
Rc::new(MainViewModel {
counter: Property::new(0),
})
}
pub fn increase(self: &Rc<Self>) {
self.counter.change(|c| c + 1);
}
}
impl ViewModel for MainViewModel {
fn create_view(self: &Rc<Self>) -> Rc<RefCell<dyn ControlObject>> {
ui!(
Horizontal {
Text { text: (&self.counter, |counter| format!("Counter {}", counter)) },
Button {
clicked: Callback::new_rc(self, |vm, _| vm.increase()),
Text { text: "Increase" }
},
}
)
}
}
fn main() -> anyhow::Result<()> {
let mut app = Application::new("Example: button").unwrap();
app.add_window(
WindowBuilder::new().with_title("Example: button"),
MainViewModel::new(),
)?;
app.run();
Ok(())
}
Licensed under
- GNU Lesser General Public License, Version 3.0 or later (LICENSE-GPL-3.0+)
- with Classpath Exception, Version 2.0 (LICENSE-Classpath-exception-2.0).
It's essentially the GNU GPL except it allows the distribution of an executable with a statically or dynamically linked library under the terms of your choice. The reason it's not LGPL is that dynamic linking is difficult with Rust.
The project is partially based on code from other projects:
- WPF's Grid.cs on MIT license
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.