From 65eb218d3d7ba52b2869a586a1480eeb3c8f84e4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Nov 2019 13:47:20 +0100 Subject: Move widgets from `core` to `native` and `web` Also made fields private and improved `Renderer` traits. --- native/src/widget.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'native/src/widget.rs') diff --git a/native/src/widget.rs b/native/src/widget.rs index 9010b06f..9dd48697 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -65,7 +65,7 @@ use crate::{layout, Event, Hasher, Layout, Length, Point}; /// /// [`Widget`]: trait.Widget.html /// [`Element`]: ../struct.Element.html -pub trait Widget: std::fmt::Debug +pub trait Widget where Renderer: crate::Renderer, { -- cgit From a7dba612f03e58d7bd9527499d893987986b347c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 22 Nov 2019 19:36:57 +0100 Subject: Write docs for `iced` and `iced_native` --- native/src/widget.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'native/src/widget.rs') diff --git a/native/src/widget.rs b/native/src/widget.rs index 61b66c5b..48605ee3 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -23,6 +23,7 @@ pub mod button; pub mod checkbox; pub mod column; +pub mod container; pub mod image; pub mod radio; pub mod row; @@ -31,8 +32,6 @@ pub mod slider; pub mod text; pub mod text_input; -mod container; - #[doc(no_inline)] pub use button::Button; #[doc(no_inline)] @@ -69,8 +68,14 @@ pub trait Widget where Renderer: crate::Renderer, { + /// Returns the width of the [`Widget`]. + /// + /// [`Widget`]: trait.Widget.html fn width(&self) -> Length; + /// Returns the height of the [`Widget`]. + /// + /// [`Widget`]: trait.Widget.html fn height(&self) -> Length; /// Returns the [`Node`] of the [`Widget`]. -- cgit From 7a8a79cd37eba3ac0f1e059b6efe34cc96b2602b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 24 Nov 2019 10:18:26 +0100 Subject: Fix links in `iced_native::Widget` --- native/src/widget.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'native/src/widget.rs') diff --git a/native/src/widget.rs b/native/src/widget.rs index 48605ee3..71dcdc0d 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -83,9 +83,9 @@ where /// This [`Node`] is used by the runtime to compute the [`Layout`] of the /// user interface. /// - /// [`Node`]: ../struct.Node.html + /// [`Node`]: ../layout/struct.Node.html /// [`Widget`]: trait.Widget.html - /// [`Layout`]: ../struct.Layout.html + /// [`Layout`]: ../layout/struct.Layout.html fn layout( &self, renderer: &Renderer, @@ -113,7 +113,7 @@ where /// its value cannot affect the overall [`Layout`] of the user interface. /// /// [`Widget`]: trait.Widget.html - /// [`Layout`]: ../struct.Layout.html + /// [`Layout`]: ../layout/struct.Layout.html /// [`Text`]: text/struct.Text.html fn hash_layout(&self, state: &mut Hasher); @@ -125,12 +125,13 @@ where /// * the current cursor position /// * a mutable `Message` list, allowing the [`Widget`] to produce /// new messages based on user interaction. + /// * the `Renderer` /// /// By default, it does nothing. /// /// [`Event`]: ../enum.Event.html /// [`Widget`]: trait.Widget.html - /// [`Layout`]: ../struct.Layout.html + /// [`Layout`]: ../layout/struct.Layout.html fn on_event( &mut self, _event: Event, -- cgit