summaryrefslogtreecommitdiffstats
path: root/web/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-24 11:03:55 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-24 11:03:55 +0100
commitb2721661f580283685e8e7a8eb32ab26453d7e8a (patch)
tree717dfc1bb0da5f714c85451135e8195d20b97c94 /web/src/widget
parentd0f79d2779d00752eef78cd98b6904cd888d59e3 (diff)
downloadiced-b2721661f580283685e8e7a8eb32ab26453d7e8a.tar.gz
iced-b2721661f580283685e8e7a8eb32ab26453d7e8a.tar.bz2
iced-b2721661f580283685e8e7a8eb32ab26453d7e8a.zip
Style `Button` min-width in `iced_web`
Diffstat (limited to 'web/src/widget')
-rw-r--r--web/src/widget/button.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs
index c9625ff8..889c0ab1 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, Color, Element, Length, Style, Widget};
+use crate::{style, Background, Bus, Element, Length, Style, Widget};
use dodrio::bumpalo;
@@ -136,13 +136,7 @@ where
let background = match self.background {
None => String::from("none"),
Some(background) => match background {
- Background::Color(Color { r, g, b, a }) => format!(
- "rgba({}, {}, {}, {})",
- 255.0 * r,
- 255.0 * g,
- 255.0 * b,
- a
- ),
+ Background::Color(color) => style::color(color),
},
};
@@ -155,9 +149,10 @@ where
"style",
bumpalo::format!(
in bump,
- "background: {}; border-radius: {}px",
+ "background: {}; border-radius: {}px; min-width: {}px",
background,
- self.border_radius
+ self.border_radius,
+ self.min_width
)
.into_bump_str(),
)