Trim the Rust ComponentWindow API and implementation a little bit

* Remove the `new` function from the main impl and use the slightly
  less visible From conversion trait
* Make the inner Rc<Window> pub(crate) instead of pub
* Instead, provide a public as_any() accessor that the Qt backend can use
This commit is contained in:
Simon Hausmann 2021-07-20 15:36:27 +02:00 committed by Simon Hausmann
parent 492af0f67c
commit 2553dd1459
6 changed files with 27 additions and 25 deletions

View file

@ -34,7 +34,7 @@ pub struct TestingBackend {
impl sixtyfps_corelib::backend::Backend for TestingBackend {
fn create_window(&'static self) -> ComponentWindow {
ComponentWindow::new(Window::new(|_| Rc::new(TestingWindow::default())))
Window::new(|_| Rc::new(TestingWindow::default())).into()
}
fn run_event_loop(&'static self, _behavior: sixtyfps_corelib::backend::EventLoopQuitBehavior) {