refactored window storage;

new helper window events (Destroyed, Created);
clippy + fmt;
This commit is contained in:
Bingus 2023-07-12 19:21:05 -07:00
parent 633f405f3f
commit d53ccc857d
No known key found for this signature in database
GPG key ID: 5F84D2AA40A9F170
56 changed files with 1508 additions and 1819 deletions

View file

@ -7,7 +7,6 @@ use crate::core::mouse;
use crate::core::touch;
use crate::core::window;
use crate::core::{Event, Point};
use crate::Position;
/// Converts a winit window event into an iced event.
pub fn window_event(
@ -169,17 +168,17 @@ pub fn window_level(level: window::Level) -> winit::window::WindowLevel {
pub fn position(
monitor: Option<&winit::monitor::MonitorHandle>,
(width, height): (u32, u32),
position: Position,
position: window::Position,
) -> Option<winit::dpi::Position> {
match position {
Position::Default => None,
Position::Specific(x, y) => {
window::Position::Default => None,
window::Position::Specific(x, y) => {
Some(winit::dpi::Position::Logical(winit::dpi::LogicalPosition {
x: f64::from(x),
y: f64::from(y),
}))
}
Position::Centered => {
window::Position::Centered => {
if let Some(monitor) = monitor {
let start = monitor.position();