diff options
author | 2019-12-30 20:54:04 +0100 | |
---|---|---|
committer | 2019-12-30 21:00:27 +0100 | |
commit | 2ff0e48142c302cb93130164d083589bb2ac4979 (patch) | |
tree | 0abdf5892d999c0e98b42849c74cab8a619fbb5e /native/src | |
parent | 74d01a69577065ce4152fc80b297e8816ab3deff (diff) | |
download | iced-2ff0e48142c302cb93130164d083589bb2ac4979.tar.gz iced-2ff0e48142c302cb93130164d083589bb2ac4979.tar.bz2 iced-2ff0e48142c302cb93130164d083589bb2ac4979.zip |
Make `Row`, `Column`, 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 1d1c32a2..d3c45fba 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), |