diff options
author | 2020-01-09 01:51:53 +0100 | |
---|---|---|
committer | 2020-01-09 01:51:53 +0100 | |
commit | 6699329d3f91c5b9d8e8e55ad88de24bd3894955 (patch) | |
tree | c41ab304ffaf2dc2311c7d33916cd0515114ad31 /native/src | |
parent | cc529a1803972604b122c19c0104e71532fff993 (diff) | |
parent | a4e833e860c41796d491ab43e84239fcca1f303d (diff) | |
download | iced-6699329d3f91c5b9d8e8e55ad88de24bd3894955.tar.gz iced-6699329d3f91c5b9d8e8e55ad88de24bd3894955.tar.bz2 iced-6699329d3f91c5b9d8e8e55ad88de24bd3894955.zip |
Merge pull request #139 from hecrj/feature/shrink-by-default
Make `Row`, `Column`, `Text`, and `Checkbox` shrink by default
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/widget/checkbox.rs | 2 | ||||
-rw-r--r-- | native/src/widget/column.rs | 2 | ||||
-rw-r--r-- | native/src/widget/radio.rs | 1 | ||||
-rw-r--r-- | native/src/widget/row.rs | 2 | ||||
-rw-r--r-- | native/src/widget/svg.rs | 2 | ||||
-rw-r--r-- | native/src/widget/text.rs | 2 | ||||
-rw-r--r-- | native/src/widget/text_input.rs | 4 |
7 files changed, 8 insertions, 7 deletions
diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 0dcac712..06a484c7 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -54,7 +54,7 @@ impl<Message> Checkbox<Message> { on_toggle: Box::new(f), label: String::from(label), label_color: None, - width: Length::Fill, + width: Length::Shrink, } } diff --git a/native/src/widget/column.rs b/native/src/widget/column.rs index 4b5d631c..0901bff4 100644 --- a/native/src/widget/column.rs +++ b/native/src/widget/column.rs @@ -33,7 +33,7 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> { Column { spacing: 0, padding: 0, - width: Length::Fill, + width: Length::Shrink, height: Length::Shrink, max_width: u32::MAX, max_height: u32::MAX, diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index a9995b86..876f4f48 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -95,6 +95,7 @@ where let size = self::Renderer::default_size(renderer); Row::<(), Renderer>::new() + .width(Length::Fill) .spacing(15) .align_items(Align::Center) .push( diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index 3de65deb..7d951968 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -33,7 +33,7 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> { Row { spacing: 0, padding: 0, - width: Length::Fill, + width: Length::Shrink, height: Length::Shrink, max_width: u32::MAX, max_height: u32::MAX, diff --git a/native/src/widget/svg.rs b/native/src/widget/svg.rs index 9580f195..25587ffa 100644 --- a/native/src/widget/svg.rs +++ b/native/src/widget/svg.rs @@ -30,7 +30,7 @@ impl Svg { Svg { handle: handle.into(), width: Length::Fill, - height: Length::Fill, + height: Length::Shrink, } } diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs index cf9c9565..caa81db0 100644 --- a/native/src/widget/text.rs +++ b/native/src/widget/text.rs @@ -41,7 +41,7 @@ impl Text { size: None, color: None, font: Font::Default, - width: Length::Fill, + width: Length::Shrink, height: Length::Shrink, horizontal_alignment: HorizontalAlignment::Left, vertical_alignment: VerticalAlignment::Top, diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index c994b7ba..f744da27 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -64,11 +64,11 @@ impl<'a, Message> TextInput<'a, Message> { placeholder: &str, value: &str, on_change: F, - ) -> Self + ) -> TextInput<'a, Message> where F: 'static + Fn(String) -> Message, { - Self { + TextInput { state, placeholder: String::from(placeholder), value: Value::new(value), |