From 0030bcbd33f5c4db60aac826552042e46b51c691 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 5 Feb 2020 00:23:22 +0100 Subject: Rename module `style` to `css` in `iced_web` --- web/src/widget/row.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'web/src/widget/row.rs') diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs index c26cb91b..6e184cab 100644 --- a/web/src/widget/row.rs +++ b/web/src/widget/row.rs @@ -1,4 +1,4 @@ -use crate::{style, Align, Bus, Element, Length, Style, Widget}; +use crate::{css, Align, Bus, Css, Element, Length, Widget}; use dodrio::bumpalo; use std::u32; @@ -113,7 +113,7 @@ impl<'a, Message> Widget for Row<'a, Message> { &self, bump: &'b bumpalo::Bump, publish: &Bus, - style_sheet: &mut style::Sheet<'b>, + style_sheet: &mut Css<'b>, ) -> dodrio::Node<'b> { use dodrio::builder::*; @@ -123,18 +123,18 @@ impl<'a, Message> Widget for Row<'a, Message> { .map(|element| element.widget.node(bump, publish, style_sheet)) .collect(); - let row_class = style_sheet.insert(bump, Style::Row); + let row_class = style_sheet.insert(bump, css::Rule::Row); let spacing_class = - style_sheet.insert(bump, Style::Spacing(self.spacing)); + style_sheet.insert(bump, css::Rule::Spacing(self.spacing)); let padding_class = - style_sheet.insert(bump, Style::Padding(self.padding)); + style_sheet.insert(bump, css::Rule::Padding(self.padding)); - let width = style::length(self.width); - let height = style::length(self.height); + let width = css::length(self.width); + let height = css::length(self.height); - let justify_content = style::align(self.align_items); + let justify_content = css::align(self.align_items); // TODO: Complete styling div(bump) -- cgit From 28fd9feb40a024ea29f73fa91c21fc3f2cf01d58 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 5 Feb 2020 01:04:46 +0100 Subject: Support styling for `Button` in `iced_web` --- web/src/widget/row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/src/widget/row.rs') diff --git a/web/src/widget/row.rs b/web/src/widget/row.rs index 6e184cab..b360bc45 100644 --- a/web/src/widget/row.rs +++ b/web/src/widget/row.rs @@ -28,7 +28,7 @@ impl<'a, Message> Row<'a, Message> { Row { spacing: 0, padding: 0, - width: Length::Shrink, + width: Length::Fill, height: Length::Shrink, max_width: u32::MAX, max_height: u32::MAX, -- cgit From 8e83f3632c7b06370ce47d975750313a56221d28 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 6 Feb 2020 01:25:46 +0100 Subject: Fix `Column` and `Row` styling for `iced_web` --- web/src/widget/row.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'web/src/widget/row.rs') 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 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 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) -- cgit