From 3bd99221cc3b50ba9e038b1875fec91fdea8039b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 16 Nov 2022 10:01:40 +0100 Subject: Fix padding for `TextInput` with `Length::Units` width --- native/src/widget/text_input.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index ef2f9a17..14e7e1b7 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -383,19 +383,17 @@ where { let text_size = size.unwrap_or_else(|| renderer.default_size()); - let text_limits = limits + let padding = padding.fit(Size::ZERO, limits.max()); + + let limits = limits .pad(padding) .width(width) .height(Length::Units(text_size)); - let limits = limits.width(width).height(Length::Shrink); - - let mut text = layout::Node::new(text_limits.resolve(Size::ZERO)); - let padding = padding.fit(text.size(), limits.max()); - let size = limits.pad(padding).resolve(text.size()).pad(padding); + let mut text = layout::Node::new(limits.resolve(Size::ZERO)); text.move_to(Point::new(padding.left.into(), padding.top.into())); - layout::Node::with_children(size, vec![text]) + layout::Node::with_children(text.size().pad(padding), vec![text]) } /// Processes an [`Event`] and updates the [`State`] of a [`TextInput`] -- cgit From ee263cbb3c90a9adce7608686fbe5881c81f1c91 Mon Sep 17 00:00:00 2001 From: Leo Lee Date: Fri, 25 Nov 2022 17:36:42 +0800 Subject: docs: Remove invalid links. --- examples/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/README.md b/examples/README.md index bb15dc2e..8d9718a4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -92,7 +92,6 @@ A bunch of simpler examples exist: - [`custom_widget`](custom_widget), a demonstration of how to build a custom widget that draws a circle. - [`download_progress`](download_progress), a basic application that asynchronously downloads a dummy file of 100 MB and tracks the download progress. - [`events`](events), a log of native events displayed using a conditional `Subscription`. -- [`geometry`](geometry), a custom widget showcasing how to draw geometry with the `Mesh2D` primitive in [`iced_wgpu`](../wgpu). - [`integration_opengl`](integration_opengl), a demonstration of how to integrate Iced in an existing OpenGL application. - [`integration_wgpu`](integration_wgpu), a demonstration of how to integrate Iced in an existing [`wgpu`] application. - [`pane_grid`](pane_grid), a grid of panes that can be split, resized, and reorganized. -- cgit