Skip to content

Commit

Permalink
Update to latest concoct
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Dec 15, 2023
1 parent 004025f commit ae800f0
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 11 deletions.
112 changes: 108 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "viewbuilder"
version = "0.9.1"
version = "0.9.2"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Cross-platform UI framework"
Expand All @@ -14,7 +14,7 @@ full = ["Window"]
[dependencies]
tokio = { version = "1.32.0", features = ["full"], optional = true }
winit = { version = "0.28.1", optional = true }
concoct = { version = "0.15.1", features = ["full"] }
concoct = { version = "0.16.3", features = ["full"] }

[package.metadata.docs.rs]
features = ["full"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Object for App {}
fn main() {
let event_loop = EventLoop::<()>::new().start();

let window = Window::new().start();
let window = Window::create();
Window::insert(&mut window.cx(), &event_loop);

let app = App.start();
Expand Down
4 changes: 2 additions & 2 deletions examples/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ impl App {
impl Object for App {}

fn main() {
let event_loop = EventLoop::<()>::new().start();
let event_loop = EventLoop::<()>::create();

let window = Window::new().start();
let window = Window::create();
Window::insert(&mut window.cx(), &event_loop);

let app = App.start();
Expand Down
6 changes: 6 additions & 0 deletions src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ pub struct EventLoop<E: 'static> {
control_flow: ControlFlow,
}

impl<E: 'static> Default for EventLoop<E> {
fn default() -> Self {
Self::new()
}
}

impl<E: 'static> EventLoop<E> {
pub fn new() -> Self {
Self {
Expand Down
10 changes: 8 additions & 2 deletions src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ enum WindowState {
///
/// impl Object for App {}
///
/// let event_loop = EventLoop::<()>::new().start();
/// let event_loop = EventLoop::<()>::create();
///
/// let window = Window::new().start();
/// let window = Window::create;
/// Window::insert(&mut window.cx(), &event_loop);
///
/// let app = App.start();
Expand All @@ -42,6 +42,12 @@ pub struct Window {
state: Option<WindowState>,
}

impl Default for Window {
fn default() -> Self {
Self::new()
}
}

impl Window {
pub fn new() -> Self {
Self::builder().build()
Expand Down

0 comments on commit ae800f0

Please sign in to comment.