summaryrefslogtreecommitdiffstats
path: root/web/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-05 00:23:22 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-05 00:23:22 +0100
commit0030bcbd33f5c4db60aac826552042e46b51c691 (patch)
tree08f2ef54d673fb94d02b23644bbc3c204f80998b /web/src/widget
parent7b892eb3e11596925a2993bcc4175ac09ff3768a (diff)
downloadiced-0030bcbd33f5c4db60aac826552042e46b51c691.tar.gz
iced-0030bcbd33f5c4db60aac826552042e46b51c691.tar.bz2
iced-0030bcbd33f5c4db60aac826552042e46b51c691.zip
Rename module `style` to `css` in `iced_web`
Diffstat (limited to 'web/src/widget')
-rw-r--r--web/src/widget/button.rs10
-rw-r--r--web/src/widget/checkbox.rs4
-rw-r--r--web/src/widget/column.rs16
-rw-r--r--web/src/widget/container.rs14
-rw-r--r--web/src/widget/image.rs4
-rw-r--r--web/src/widget/radio.rs4
-rw-r--r--web/src/widget/row.rs16
-rw-r--r--web/src/widget/scrollable.rs8
-rw-r--r--web/src/widget/slider.rs4
-rw-r--r--web/src/widget/space.rs8
-rw-r--r--web/src/widget/text.rs10
-rw-r--r--web/src/widget/text_input.rs10
12 files changed, 54 insertions, 54 deletions
diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs
index 6fef48ce..f3b3e69a 100644
--- a/web/src/widget/button.rs
+++ b/web/src/widget/button.rs
@@ -4,7 +4,7 @@
//!
//! [`Button`]: struct.Button.html
//! [`State`]: struct.State.html
-use crate::{style, Background, Bus, Element, Length, Style, Widget};
+use crate::{css, Background, Bus, Css, Element, Length, Widget};
use dodrio::bumpalo;
@@ -126,18 +126,18 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- style_sheet: &mut style::Sheet<'b>,
+ style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
- let width = style::length(self.width);
+ let width = css::length(self.width);
let padding_class =
- style_sheet.insert(bump, Style::Padding(self.padding));
+ style_sheet.insert(bump, css::Rule::Padding(self.padding));
let background = match self.background {
None => String::from("none"),
Some(background) => match background {
- Background::Color(color) => style::color(color),
+ Background::Color(color) => css::color(color),
},
};
diff --git a/web/src/widget/checkbox.rs b/web/src/widget/checkbox.rs
index 1e864875..d1d30048 100644
--- a/web/src/widget/checkbox.rs
+++ b/web/src/widget/checkbox.rs
@@ -1,4 +1,4 @@
-use crate::{style, Bus, Color, Element, Widget};
+use crate::{Bus, Color, Css, Element, Widget};
use dodrio::bumpalo;
use std::rc::Rc;
@@ -68,7 +68,7 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
diff --git a/web/src/widget/column.rs b/web/src/widget/column.rs
index 9aa988ff..8e36231a 100644
--- a/web/src/widget/column.rs
+++ b/web/src/widget/column.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;
@@ -112,7 +112,7 @@ impl<'a, Message> Widget<Message> for Column<'a, Message> {
&self,
bump: &'b bumpalo::Bump,
publish: &Bus<Message>,
- style_sheet: &mut style::Sheet<'b>,
+ style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
@@ -122,18 +122,18 @@ impl<'a, Message> Widget<Message> for Column<'a, Message> {
.map(|element| element.widget.node(bump, publish, style_sheet))
.collect();
- let column_class = style_sheet.insert(bump, Style::Column);
+ let column_class = style_sheet.insert(bump, css::Rule::Column);
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 align_items = style::align(self.align_items);
+ let align_items = css::align(self.align_items);
// TODO: Complete styling
div(bump)
diff --git a/web/src/widget/container.rs b/web/src/widget/container.rs
index bdc88979..55995795 100644
--- a/web/src/widget/container.rs
+++ b/web/src/widget/container.rs
@@ -1,4 +1,4 @@
-use crate::{bumpalo, style, Align, Bus, Element, Length, Style, Widget};
+use crate::{bumpalo, css, Align, Bus, Css, Element, Length, Widget};
/// An element decorating some content.
///
@@ -94,17 +94,17 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- style_sheet: &mut style::Sheet<'b>,
+ style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
- let column_class = style_sheet.insert(bump, Style::Column);
+ let column_class = style_sheet.insert(bump, css::Rule::Column);
- 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 align_items = style::align(self.horizontal_alignment);
- let justify_content = style::align(self.vertical_alignment);
+ let align_items = css::align(self.horizontal_alignment);
+ let justify_content = css::align(self.vertical_alignment);
let node = div(bump)
.attr(
diff --git a/web/src/widget/image.rs b/web/src/widget/image.rs
index 413b663e..17e9b0f7 100644
--- a/web/src/widget/image.rs
+++ b/web/src/widget/image.rs
@@ -1,4 +1,4 @@
-use crate::{style, Bus, Element, Length, Widget};
+use crate::{Bus, Css, Element, Length, Widget};
use dodrio::bumpalo;
@@ -57,7 +57,7 @@ impl<Message> Widget<Message> for Image {
&self,
bump: &'b bumpalo::Bump,
_bus: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
diff --git a/web/src/widget/radio.rs b/web/src/widget/radio.rs
index 6dd0ad45..4570639c 100644
--- a/web/src/widget/radio.rs
+++ b/web/src/widget/radio.rs
@@ -1,4 +1,4 @@
-use crate::{style, Bus, Color, Element, Widget};
+use crate::{Bus, Color, Css, Element, Widget};
use dodrio::bumpalo;
@@ -76,7 +76,7 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
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<Message> for Row<'a, Message> {
&self,
bump: &'b bumpalo::Bump,
publish: &Bus<Message>,
- 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<Message> 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)
diff --git a/web/src/widget/scrollable.rs b/web/src/widget/scrollable.rs
index f146e007..19810531 100644
--- a/web/src/widget/scrollable.rs
+++ b/web/src/widget/scrollable.rs
@@ -1,5 +1,5 @@
//! Navigate an endless amount of content with a scrollbar.
-use crate::{bumpalo, style, Align, Bus, Column, Element, Length, Widget};
+use crate::{bumpalo, css, Align, Bus, Column, Css, Element, Length, Widget};
/// A widget that can vertically display an infinite amount of content with a
/// scrollbar.
@@ -105,12 +105,12 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- style_sheet: &mut style::Sheet<'b>,
+ style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
- 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 node = div(bump)
.attr(
diff --git a/web/src/widget/slider.rs b/web/src/widget/slider.rs
index 25c57933..843003e6 100644
--- a/web/src/widget/slider.rs
+++ b/web/src/widget/slider.rs
@@ -4,7 +4,7 @@
//!
//! [`Slider`]: struct.Slider.html
//! [`State`]: struct.State.html
-use crate::{style, Bus, Element, Length, Widget};
+use crate::{Bus, Css, Element, Length, Widget};
use dodrio::bumpalo;
use std::{ops::RangeInclusive, rc::Rc};
@@ -88,7 +88,7 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
use wasm_bindgen::JsCast;
diff --git a/web/src/widget/space.rs b/web/src/widget/space.rs
index baf4c80b..4ce52595 100644
--- a/web/src/widget/space.rs
+++ b/web/src/widget/space.rs
@@ -1,4 +1,4 @@
-use crate::{style, Bus, Element, Length, Widget};
+use crate::{css, Bus, Css, Element, Length, Widget};
use dodrio::bumpalo;
/// An amount of empty space.
@@ -44,12 +44,12 @@ impl<'a, Message> Widget<Message> for Space {
&self,
bump: &'b bumpalo::Bump,
_publish: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _css: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
- 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 style = bumpalo::format!(
in bump,
diff --git a/web/src/widget/text.rs b/web/src/widget/text.rs
index 5b0bee55..c5b07747 100644
--- a/web/src/widget/text.rs
+++ b/web/src/widget/text.rs
@@ -1,5 +1,5 @@
use crate::{
- style, Bus, Color, Element, Font, HorizontalAlignment, Length,
+ css, Bus, Color, Css, Element, Font, HorizontalAlignment, Length,
VerticalAlignment, Widget,
};
use dodrio::bumpalo;
@@ -112,15 +112,15 @@ impl<'a, Message> Widget<Message> for Text {
&self,
bump: &'b bumpalo::Bump,
_publish: &Bus<Message>,
- _style_sheet: &mut style::Sheet<'b>,
+ _style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
let content = bumpalo::format!(in bump, "{}", self.content);
- let color = style::color(self.color.unwrap_or(Color::BLACK));
+ let color = css::color(self.color.unwrap_or(Color::BLACK));
- 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 text_align = match self.horizontal_alignment {
HorizontalAlignment::Left => "left",
diff --git a/web/src/widget/text_input.rs b/web/src/widget/text_input.rs
index 078e05b2..1fea787a 100644
--- a/web/src/widget/text_input.rs
+++ b/web/src/widget/text_input.rs
@@ -4,7 +4,7 @@
//!
//! [`TextInput`]: struct.TextInput.html
//! [`State`]: struct.State.html
-use crate::{bumpalo, style, Bus, Element, Length, Style, Widget};
+use crate::{bumpalo, css, Bus, Css, Element, Length, Widget};
use std::rc::Rc;
/// A field that can be filled with text.
@@ -133,15 +133,15 @@ where
&self,
bump: &'b bumpalo::Bump,
bus: &Bus<Message>,
- style_sheet: &mut style::Sheet<'b>,
+ style_sheet: &mut Css<'b>,
) -> dodrio::Node<'b> {
use dodrio::builder::*;
use wasm_bindgen::JsCast;
- let width = style::length(self.width);
- let max_width = style::length(self.max_width);
+ let width = css::length(self.width);
+ let max_width = css::length(self.max_width);
let padding_class =
- style_sheet.insert(bump, Style::Padding(self.padding));
+ style_sheet.insert(bump, css::Rule::Padding(self.padding));
let on_change = self.on_change.clone();
let event_bus = bus.clone();