From e8049af23dbf4988ff24b75b90104295f61098a2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 15 Feb 2024 02:08:22 +0100 Subject: Make `horizontal_space` and `vertical_space` fill by default --- widget/src/helpers.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'widget/src/helpers.rs') diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index e9898d67..400fced5 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -305,15 +305,15 @@ where /// Creates a new horizontal [`Space`] with the given [`Length`]. /// /// [`Space`]: crate::Space -pub fn horizontal_space(width: impl Into) -> Space { - Space::with_width(width) +pub fn horizontal_space() -> Space { + Space::with_width(Length::Fill) } /// Creates a new vertical [`Space`] with the given [`Length`]. /// /// [`Space`]: crate::Space -pub fn vertical_space(height: impl Into) -> Space { - Space::with_height(height) +pub fn vertical_space() -> Space { + Space::with_height(Length::Fill) } /// Creates a horizontal [`Rule`] with the given height. -- cgit From feab96f323189ebae070a5d025531f86e436e21f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 15 Feb 2024 02:38:07 +0100 Subject: Add `push_maybe` to `Column` and `Row` --- widget/src/helpers.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'widget/src/helpers.rs') diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 400fced5..6ae35aee 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -387,6 +387,18 @@ where crate::Canvas::new(program) } +/// Creates a new [`QRCode`] widget from the given [`Data`]. +/// +/// [`Svg`]: crate::QRCode +/// [`Data`]: crate::qr_code::Data +#[cfg(feature = "qr_code")] +pub fn qr_code(data: &crate::qr_code::Data) -> crate::QRCode<'_, Theme> +where + Theme: crate::qr_code::StyleSheet, +{ + crate::QRCode::new(data) +} + /// Creates a new [`Shader`]. /// /// [`Shader`]: crate::Shader -- cgit From 777e2e34f50c440f59d9a407f75be80fbbfaccae Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 15 Feb 2024 02:47:35 +0100 Subject: Fix documentation for `qr_code` widget helper --- widget/src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'widget/src/helpers.rs') diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 6ae35aee..3f2e56cd 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -389,7 +389,7 @@ where /// Creates a new [`QRCode`] widget from the given [`Data`]. /// -/// [`Svg`]: crate::QRCode +/// [`QRCode`]: crate::QRCode /// [`Data`]: crate::qr_code::Data #[cfg(feature = "qr_code")] pub fn qr_code(data: &crate::qr_code::Data) -> crate::QRCode<'_, Theme> -- cgit