refactor: minor
parent
1e9b7f0e0e
commit
6654e0f9bc
|
@ -192,8 +192,6 @@ impl WindowingSystem {
|
||||||
femtovg_window.set_scale_factor(config.scale_factor);
|
femtovg_window.set_scale_factor(config.scale_factor);
|
||||||
femtovg_window.set_position(LogicalPosition::new(0., 0.));
|
femtovg_window.set_position(LogicalPosition::new(0., 0.));
|
||||||
|
|
||||||
//debug!("Setting up custom Slint platform");
|
|
||||||
|
|
||||||
debug!("Creating Slint component instance");
|
debug!("Creating Slint component instance");
|
||||||
|
|
||||||
state.set_window(Rc::clone(&femtovg_window));
|
state.set_window(Rc::clone(&femtovg_window));
|
||||||
|
@ -208,13 +206,9 @@ impl WindowingSystem {
|
||||||
pub fn run(&mut self) -> Result<()> {
|
pub fn run(&mut self) -> Result<()> {
|
||||||
info!("Starting WindowingSystem main loop");
|
info!("Starting WindowingSystem main loop");
|
||||||
if let Some(window) = &self.state.window() {
|
if let Some(window) = &self.state.window() {
|
||||||
/*let platform = CustomSlintPlatform::new(window);
|
|
||||||
slint::platform::set_platform(Box::new(platform))
|
|
||||||
.map_err(|e| anyhow::anyhow!("Failed to set platform: {:?}", e))?;
|
|
||||||
*/
|
|
||||||
window.render_frame_if_dirty();
|
window.render_frame_if_dirty();
|
||||||
}
|
}
|
||||||
self.state.show_component();
|
self.state.show_component()?;
|
||||||
self.setup_wayland_event_source();
|
self.setup_wayland_event_source();
|
||||||
|
|
||||||
self.event_loop
|
self.event_loop
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{borrow::{Borrow, BorrowMut}, rc::Rc};
|
use std::{rc::Rc};
|
||||||
use log::info;
|
use log::info;
|
||||||
use slint::{LogicalPosition, PhysicalSize, ComponentHandle};
|
use slint::{LogicalPosition, PhysicalSize, ComponentHandle};
|
||||||
use slint_interpreter::{ComponentDefinition, ComponentInstance};
|
use slint_interpreter::{ComponentDefinition, ComponentInstance};
|
||||||
|
@ -131,6 +131,6 @@ impl WindowState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn component_instance(&self) -> &ComponentInstance {
|
pub fn component_instance(&self) -> &ComponentInstance {
|
||||||
&self.component_instance.as_ref().unwrap()
|
self.component_instance.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue