summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 01:25:46 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 01:25:46 +0100
commit8e83f3632c7b06370ce47d975750313a56221d28 (patch)
treef6f0e9df56f227547375f9197a50b4e31a5f1799 /web
parent6c8fdfefbe6ea8cd1cc11a4a822285c28c278880 (diff)
downloadiced-8e83f3632c7b06370ce47d975750313a56221d28.tar.gz
iced-8e83f3632c7b06370ce47d975750313a56221d28.tar.bz2
iced-8e83f3632c7b06370ce47d975750313a56221d28.zip
Fix `Column` and `Row` styling for `iced_web`
Diffstat (limited to 'web')
-rw-r--r--web/src/widget/column.rs17
-rw-r--r--web/src/widget/row.rs17
2 files changed, 12 insertions, 22 deletions
diff --git a/web/src/widget/column.rs b/web/src/widget/column.rs
index 640d3673..6454ffba 100644
--- a/web/src/widget/column.rs
+++ b/web/src/widget/column.rs
@@ -130,11 +130,6 @@ impl<'a, Message> Widget<Message> for Column<'a, Message> {
let padding_class =
style_sheet.insert(bump, css::Rule::Padding(self.padding));
- let width = css::length(self.width);
- let height = css::length(self.height);
-
- let align_items = css::align(self.align_items);
-
// TODO: Complete styling
div(bump)
.attr(
@@ -144,12 +139,12 @@ impl<'a, Message> Widget<Message> for Column<'a, Message> {
)
.attr("style", bumpalo::format!(
in bump,
- "width: {}; height: {}; max-width: {}px; max-height: {}px; align-items: {}",
- width,
- height,
- self.max_width,
- self.max_height,
- align_items
+ "width: {}; height: {}; max-width: {}; max-height: {}; align-items: {}",
+ css::length(self.width),
+ css::length(self.height),
+ css::max_length(self.max_width),
+ css::max_length(self.max_height),
+ css::align(self.align_items)
).into_bump_str()
)
.children(children)
diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs
index b360bc45..02035113 100644
--- a/web/src/widget/row.rs
+++ b/web/src/widget/row.rs
@@ -131,11 +131,6 @@ impl<'a, Message> Widget<Message> for Row<'a, Message> {
let padding_class =
style_sheet.insert(bump, css::Rule::Padding(self.padding));
- let width = css::length(self.width);
- let height = css::length(self.height);
-
- let justify_content = css::align(self.align_items);
-
// TODO: Complete styling
div(bump)
.attr(
@@ -145,12 +140,12 @@ impl<'a, Message> Widget<Message> for Row<'a, Message> {
)
.attr("style", bumpalo::format!(
in bump,
- "width: {}; height: {}; max-width: {}px; max-height: {}px; justify-content: {}",
- width,
- height,
- self.max_width,
- self.max_height,
- justify_content
+ "width: {}; height: {}; max-width: {}; max-height: {}; align-items: {}",
+ css::length(self.width),
+ css::length(self.height),
+ css::max_length(self.max_width),
+ css::max_length(self.max_height),
+ css::align(self.align_items)
).into_bump_str()
)
.children(children)