Rename horizontal_rule to rule and introduce Rule::vertical

This commit is contained in:
Héctor Ramón Jiménez 2025-09-11 06:51:53 +02:00
parent c70ce5af89
commit c684fbd6af
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 63 additions and 86 deletions

View file

@ -3,8 +3,7 @@ use iced::keyboard;
use iced::mouse;
use iced::widget::{
button, canvas, center, center_y, checkbox, column, container,
horizontal_rule, horizontal_space, pick_list, pin, row, scrollable, stack,
text, vertical_rule,
horizontal_space, pick_list, pin, row, rule, scrollable, stack, text,
};
use iced::{
Center, Element, Fill, Font, Length, Point, Rectangle, Renderer, Shrink,
@ -295,7 +294,7 @@ fn quotes<'a>() -> Element<'a, Message> {
fn quote<'a>(
content: impl Into<Element<'a, Message>>,
) -> Element<'a, Message> {
row![vertical_rule(1), content.into()]
row![rule(1).vertical(), content.into()]
.spacing(10)
.height(Shrink)
.into()
@ -313,7 +312,7 @@ fn quotes<'a>() -> Element<'a, Message> {
reply("This is the original message", "This is a reply"),
"This is another reply",
),
horizontal_rule(1),
rule(1),
text("A separator ↑"),
]
.width(Shrink)

View file

@ -1,8 +1,8 @@
use iced::keyboard;
use iced::widget::{
button, center_x, center_y, checkbox, column, container, horizontal_rule,
pick_list, progress_bar, row, scrollable, slider, text, text_input,
toggler, vertical_rule, vertical_space,
button, center_x, center_y, checkbox, column, container, pick_list,
progress_bar, row, rule, scrollable, slider, text, text_input, toggler,
vertical_space,
};
use iced::{Center, Element, Fill, Shrink, Subscription, Theme};
@ -162,14 +162,14 @@ impl Styling {
let content = column![
choose_theme,
horizontal_rule(1),
rule(1),
text_input,
buttons,
slider(),
progress_bar(),
row![
scroll_me,
vertical_rule(1),
rule(1).vertical(),
column![check, check_disabled, toggle, disabled_toggle]
.spacing(10)
]

View file

@ -172,7 +172,7 @@ mod toast {
use iced::theme;
use iced::time::{self, Duration, Instant};
use iced::widget::{
button, column, container, horizontal_rule, horizontal_space, row, text,
button, column, container, horizontal_space, row, rule, text,
};
use iced::window;
use iced::{
@ -254,7 +254,7 @@ mod toast {
Status::Success => success,
Status::Danger => danger,
}),
horizontal_rule(1),
rule(1),
container(text(toast.body.as_str()))
.width(Fill)
.padding(5)