summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 19:08:21 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-24 19:08:21 +0100
commite77fa175aa0eaf62be4ebafbd8e0dbc5df18f006 (patch)
tree78608f77c6db3ff1e61a58008bd54d114f32352c /web
parent7cb1452d29ddfdcd29fd7ecc7c96a79ea2681fce (diff)
parentfd7d9622e333a0a2cd5c2e8e6cc38cc09d7981e4 (diff)
downloadiced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.gz
iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.tar.bz2
iced-e77fa175aa0eaf62be4ebafbd8e0dbc5df18f006.zip
Merge branch 'master' into feature/text-selection
Diffstat (limited to '')
-rw-r--r--web/README.md2
-rw-r--r--web/src/lib.rs4
-rw-r--r--web/src/widget/column.rs9
-rw-r--r--web/src/widget/row.rs9
4 files changed, 19 insertions, 5 deletions
diff --git a/web/README.md b/web/README.md
index aceb4a97..83d1500f 100644
--- a/web/README.md
+++ b/web/README.md
@@ -36,7 +36,7 @@ For instance, let's say we want to build the [`tour` example]:
```
cd examples
cargo build --package tour --target wasm32-unknown-unknown
-wasm-bindgen ../target/wasm32-unknown-unknown/debug/examples/tour.wasm --out-dir tour --web
+wasm-bindgen ../target/wasm32-unknown-unknown/debug/tour.wasm --out-dir tour --web
```
*__Note:__ Keep in mind that Iced is still in early exploration stages and most of the work needs to happen on the native side of the ecosystem. At this stage, it is important to be able to batch work without having to constantly jump back and forth. Because of this, there is currently no requirement for the `master` branch to contain a cross-platform API at all times. If you hit an issue when building an example and want to help, it may be a good way to [start contributing]!*
diff --git a/web/src/lib.rs b/web/src/lib.rs
index 258ad9e7..1de00545 100644
--- a/web/src/lib.rs
+++ b/web/src/lib.rs
@@ -73,8 +73,8 @@ pub use dodrio;
pub use element::Element;
pub use hasher::Hasher;
pub use iced_core::{
- Align, Background, Color, Font, HorizontalAlignment, Length, Point, Size,
- Vector, VerticalAlignment,
+ keyboard, Align, Background, Color, Font, HorizontalAlignment, Length,
+ Point, Size, Vector, VerticalAlignment,
};
pub use iced_futures::{executor, futures, Command};
pub use subscription::Subscription;
diff --git a/web/src/widget/column.rs b/web/src/widget/column.rs
index 6454ffba..25b88b0e 100644
--- a/web/src/widget/column.rs
+++ b/web/src/widget/column.rs
@@ -25,6 +25,13 @@ impl<'a, Message> Column<'a, Message> {
///
/// [`Column`]: struct.Column.html
pub fn new() -> Self {
+ Self::with_children(Vec::new())
+ }
+
+ /// Creates a [`Column`] with the given elements.
+ ///
+ /// [`Column`]: struct.Column.html
+ pub fn with_children(children: Vec<Element<'a, Message>>) -> Self {
Column {
spacing: 0,
padding: 0,
@@ -33,7 +40,7 @@ impl<'a, Message> Column<'a, Message> {
max_width: u32::MAX,
max_height: u32::MAX,
align_items: Align::Start,
- children: Vec::new(),
+ children,
}
}
diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs
index 02035113..cfa10fdf 100644
--- a/web/src/widget/row.rs
+++ b/web/src/widget/row.rs
@@ -25,6 +25,13 @@ impl<'a, Message> Row<'a, Message> {
///
/// [`Row`]: struct.Row.html
pub fn new() -> Self {
+ Self::with_children(Vec::new())
+ }
+
+ /// Creates a [`Row`] with the given elements.
+ ///
+ /// [`Row`]: struct.Row.html
+ pub fn with_children(children: Vec<Element<'a, Message>>) -> Self {
Row {
spacing: 0,
padding: 0,
@@ -33,7 +40,7 @@ impl<'a, Message> Row<'a, Message> {
max_width: u32::MAX,
max_height: u32::MAX,
align_items: Align::Start,
- children: Vec::new(),
+ children,
}
}