refactor(settings/section): deprecate view_section for settings::section
This commit is contained in:
parent
c4e8f4d1e6
commit
af68a3f660
2 changed files with 7 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ pub mod item;
|
||||||
pub mod section;
|
pub mod section;
|
||||||
|
|
||||||
pub use self::item::{flex_item, flex_item_row, item, item_row};
|
pub use self::item::{flex_item, flex_item_row, item, item_row};
|
||||||
pub use self::section::{view_section, Section};
|
pub use self::section::{section, view_section, Section};
|
||||||
|
|
||||||
use crate::widget::{column, Column};
|
use crate::widget::{column, Column};
|
||||||
use crate::Element;
|
use crate::Element;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use crate::Element;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
/// A section within a settings view column.
|
/// A section within a settings view column.
|
||||||
|
#[deprecated(note = "use `settings::section().title()` instead")]
|
||||||
pub fn view_section<'a, Message: 'static>(title: impl Into<Cow<'a, str>>) -> Section<'a, Message> {
|
pub fn view_section<'a, Message: 'static>(title: impl Into<Cow<'a, str>>) -> Section<'a, Message> {
|
||||||
Section {
|
Section {
|
||||||
title: title.into(),
|
title: title.into(),
|
||||||
|
|
@ -14,6 +15,11 @@ pub fn view_section<'a, Message: 'static>(title: impl Into<Cow<'a, str>>) -> Sec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A section within a settings view column.
|
||||||
|
pub fn section<'a, Message: 'static>() -> Section<'a, Message> {
|
||||||
|
with_column(ListColumn::default())
|
||||||
|
}
|
||||||
|
|
||||||
/// A section with a pre-defined list column.
|
/// A section with a pre-defined list column.
|
||||||
pub fn with_column<'a, Message: 'static>(
|
pub fn with_column<'a, Message: 'static>(
|
||||||
children: ListColumn<'a, Message>,
|
children: ListColumn<'a, Message>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue