diff options
author | 2025-01-24 15:55:24 +0100 | |
---|---|---|
committer | 2025-01-24 15:55:24 +0100 | |
commit | f8337b8da7ff6bcf876b54d1c7dac460d2e03747 (patch) | |
tree | 495d96fc62b23af7ce2622e87892ca823f1c61fc /examples/editor | |
parent | 75a6f32a5ef49bb8e6d16506d84b07822a33c41b (diff) | |
download | iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.gz iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.tar.bz2 iced-f8337b8da7ff6bcf876b54d1c7dac460d2e03747.zip |
Add helper functions for alignment to `widget` module
Diffstat (limited to 'examples/editor')
-rw-r--r-- | examples/editor/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Message>, ) -> 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( |