From 27ac85a9d98474904c422a891e54888376dec00a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 14 Sep 2019 20:54:50 +0200 Subject: Draft web runtime and widgets --- web/src/widget.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 web/src/widget.rs (limited to 'web/src/widget.rs') diff --git a/web/src/widget.rs b/web/src/widget.rs new file mode 100644 index 00000000..5cb89a60 --- /dev/null +++ b/web/src/widget.rs @@ -0,0 +1,20 @@ +pub mod button; +pub mod slider; +pub mod text; + +mod checkbox; +mod column; +mod image; +mod radio; +mod row; + +pub use button::Button; +pub use checkbox::Checkbox; +pub use column::Column; +pub use image::Image; +pub use radio::Radio; +pub use row::Row; +pub use slider::Slider; +pub use text::Text; + +pub trait Widget {} -- cgit From 8834772fa70850559f7bd82cc8432394e3fd9db7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 15 Sep 2019 17:43:15 +0200 Subject: Draft widget nodes and wire interaction --- web/src/widget.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'web/src/widget.rs') diff --git a/web/src/widget.rs b/web/src/widget.rs index 5cb89a60..7af592e1 100644 --- a/web/src/widget.rs +++ b/web/src/widget.rs @@ -1,3 +1,6 @@ +use crate::Bus; +use dodrio::bumpalo; + pub mod button; pub mod slider; pub mod text; @@ -17,4 +20,14 @@ pub use row::Row; pub use slider::Slider; pub use text::Text; -pub trait Widget {} +pub trait Widget { + fn node<'b>( + &self, + bump: &'b bumpalo::Bump, + _bus: &Bus, + ) -> dodrio::Node<'b> { + use dodrio::builder::*; + + div(bump).children(vec![text("WIP")]).finish() + } +} -- cgit From 655978f480c32bc696f0d5fe2fff834bfbf238ea Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 15 Sep 2019 18:53:13 +0200 Subject: Draft nodes for missing widgets --- web/src/widget.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'web/src/widget.rs') diff --git a/web/src/widget.rs b/web/src/widget.rs index 7af592e1..67ca8e81 100644 --- a/web/src/widget.rs +++ b/web/src/widget.rs @@ -25,9 +25,5 @@ pub trait Widget { &self, bump: &'b bumpalo::Bump, _bus: &Bus, - ) -> dodrio::Node<'b> { - use dodrio::builder::*; - - div(bump).children(vec![text("WIP")]).finish() - } + ) -> dodrio::Node<'b>; } -- cgit From 5e28f80af8349be2638eb80d2a06c81fd14d631c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 24 Sep 2019 15:15:34 +0200 Subject: Improve documentation --- web/src/widget.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'web/src/widget.rs') diff --git a/web/src/widget.rs b/web/src/widget.rs index 67ca8e81..88b2efc9 100644 --- a/web/src/widget.rs +++ b/web/src/widget.rs @@ -11,14 +11,20 @@ mod image; mod radio; mod row; +#[doc(no_inline)] pub use button::Button; + +#[doc(no_inline)] +pub use slider::Slider; + +#[doc(no_inline)] +pub use text::Text; + pub use checkbox::Checkbox; pub use column::Column; pub use image::Image; pub use radio::Radio; pub use row::Row; -pub use slider::Slider; -pub use text::Text; pub trait Widget { fn node<'b>( -- cgit