refactor: minor imports
parent
e5f26fa311
commit
721c8ca91d
|
@ -4,6 +4,7 @@ use crate::{
|
||||||
rendering::{egl_context::EGLContext, femtovg_window::FemtoVGWindow},
|
rendering::{egl_context::EGLContext, femtovg_window::FemtoVGWindow},
|
||||||
};
|
};
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
|
use config::WindowConfig;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
use slint::{platform::femtovg_renderer::FemtoVGRenderer, LogicalPosition, PhysicalSize};
|
use slint::{platform::femtovg_renderer::FemtoVGRenderer, LogicalPosition, PhysicalSize};
|
||||||
use slint_interpreter::ComponentInstance;
|
use slint_interpreter::ComponentInstance;
|
||||||
|
@ -37,7 +38,7 @@ pub struct WindowingSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowingSystem {
|
impl WindowingSystem {
|
||||||
fn new(config: &mut config::WindowConfig) -> Result<Self> {
|
fn new(config: &mut WindowConfig) -> Result<Self> {
|
||||||
info!("Initializing WindowingSystem");
|
info!("Initializing WindowingSystem");
|
||||||
let connection = Rc::new(Connection::connect_to_env()?);
|
let connection = Rc::new(Connection::connect_to_env()?);
|
||||||
let event_queue = connection.new_event_queue();
|
let event_queue = connection.new_event_queue();
|
||||||
|
@ -106,7 +107,7 @@ impl WindowingSystem {
|
||||||
output: &WlOutput,
|
output: &WlOutput,
|
||||||
layer_shell: &ZwlrLayerShellV1,
|
layer_shell: &ZwlrLayerShellV1,
|
||||||
queue_handle: &QueueHandle<WindowState>,
|
queue_handle: &QueueHandle<WindowState>,
|
||||||
config: &config::WindowConfig,
|
config: &WindowConfig,
|
||||||
) -> (Rc<WlSurface>, Rc<ZwlrLayerSurfaceV1>) {
|
) -> (Rc<WlSurface>, Rc<ZwlrLayerSurfaceV1>) {
|
||||||
let surface = Rc::new(compositor.create_surface(queue_handle, ()));
|
let surface = Rc::new(compositor.create_surface(queue_handle, ()));
|
||||||
let layer_surface = Rc::new(layer_shell.get_layer_surface(
|
let layer_surface = Rc::new(layer_shell.get_layer_surface(
|
||||||
|
@ -126,7 +127,7 @@ impl WindowingSystem {
|
||||||
fn configure_layer_surface(
|
fn configure_layer_surface(
|
||||||
layer_surface: &Rc<ZwlrLayerSurfaceV1>,
|
layer_surface: &Rc<ZwlrLayerSurfaceV1>,
|
||||||
surface: &WlSurface,
|
surface: &WlSurface,
|
||||||
config: &config::WindowConfig,
|
config: &WindowConfig,
|
||||||
) {
|
) {
|
||||||
layer_surface.set_anchor(config.anchor);
|
layer_surface.set_anchor(config.anchor);
|
||||||
layer_surface.set_margin(
|
layer_surface.set_margin(
|
||||||
|
@ -145,7 +146,7 @@ impl WindowingSystem {
|
||||||
fn initialize_renderer(
|
fn initialize_renderer(
|
||||||
surface: &Rc<WlSurface>,
|
surface: &Rc<WlSurface>,
|
||||||
display: &WlDisplay,
|
display: &WlDisplay,
|
||||||
config: &config::WindowConfig,
|
config: &WindowConfig,
|
||||||
) -> Result<Rc<FemtoVGWindow>> {
|
) -> Result<Rc<FemtoVGWindow>> {
|
||||||
let init_size = PhysicalSize::new(1, 1);
|
let init_size = PhysicalSize::new(1, 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue