From f8337b8da7ff6bcf876b54d1c7dac460d2e03747 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 24 Jan 2025 15:55:24 +0100 Subject: Add helper functions for alignment to `widget` module --- examples/editor/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/editor') diff --git a/examples/editor/src/main.rs b/examples/editor/src/main.rs index d55f9bdf..7032324a 100644 --- a/examples/editor/src/main.rs +++ b/examples/editor/src/main.rs @@ -1,8 +1,8 @@ use iced::highlighter; use iced::keyboard; use iced::widget::{ - self, button, column, container, horizontal_space, pick_list, row, text, - text_editor, toggler, tooltip, + self, button, center_x, column, container, horizontal_space, pick_list, + row, text, text_editor, toggler, tooltip, }; use iced::{Center, Element, Fill, Font, Task, Theme}; @@ -288,7 +288,7 @@ fn action<'a, Message: Clone + 'a>( label: &'a str, on_press: Option, ) -> Element<'a, Message> { - let action = button(container(content).center_x(30)); + let action = button(center_x(content).width(30)); if let Some(on_press) = on_press { tooltip( -- cgit