Skip to content

Commit af68a3f

Browse files
committed
refactor(settings/section): deprecate view_section for settings::section
1 parent c4e8f4d commit af68a3f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/widget/settings/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod item;
55
pub mod section;
66

77
pub use self::item::{flex_item, flex_item_row, item, item_row};
8-
pub use self::section::{view_section, Section};
8+
pub use self::section::{section, view_section, Section};
99

1010
use crate::widget::{column, Column};
1111
use crate::Element;

src/widget/settings/section.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ use crate::Element;
77
use std::borrow::Cow;
88

99
/// A section within a settings view column.
10+
#[deprecated(note = "use `settings::section().title()` instead")]
1011
pub fn view_section<'a, Message: 'static>(title: impl Into<Cow<'a, str>>) -> Section<'a, Message> {
1112
Section {
1213
title: title.into(),
1314
children: ListColumn::default(),
1415
}
1516
}
1617

18+
/// A section within a settings view column.
19+
pub fn section<'a, Message: 'static>() -> Section<'a, Message> {
20+
with_column(ListColumn::default())
21+
}
22+
1723
/// A section with a pre-defined list column.
1824
pub fn with_column<'a, Message: 'static>(
1925
children: ListColumn<'a, Message>,

0 commit comments

Comments
 (0)