Add helper functions for alignment to widget module

This commit is contained in:
Héctor Ramón Jiménez 2025-01-24 15:55:24 +01:00
parent 75a6f32a5e
commit f8337b8da7
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
12 changed files with 208 additions and 64 deletions

View file

@ -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(