Merge branch 'main' into divs

This commit is contained in:
Nathan Sobo 2023-08-22 16:35:56 -06:00
commit d375f7992d
277 changed files with 19044 additions and 8896 deletions

View file

@ -24,6 +24,7 @@ use crate::{
use anyhow::{anyhow, bail, Result};
use async_task::Runnable;
pub use event::*;
use pathfinder_geometry::vector::vec2f;
use postage::oneshot;
use schemars::JsonSchema;
use serde::Deserialize;
@ -134,6 +135,7 @@ pub trait InputHandler {
pub trait Screen: Debug {
fn as_any(&self) -> &dyn Any;
fn bounds(&self) -> RectF;
fn content_bounds(&self) -> RectF;
fn display_uuid(&self) -> Option<Uuid>;
}
@ -180,6 +182,16 @@ pub struct WindowOptions<'a> {
pub screen: Option<Rc<dyn Screen>>,
}
impl<'a> WindowOptions<'a> {
pub fn with_bounds(bounds: Vector2F) -> Self {
Self {
bounds: WindowBounds::Fixed(RectF::new(vec2f(0., 0.), bounds)),
center: true,
..Default::default()
}
}
}
#[derive(Debug, Default)]
pub struct TitlebarOptions<'a> {
pub title: Option<&'a str>,