Skip to content

Commit

Permalink
refactor(settings/section): deprecate view_section for settings::section
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Sep 19, 2024
1 parent c4e8f4d commit af68a3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod item;
pub mod section;

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::Element;
Expand Down
6 changes: 6 additions & 0 deletions src/widget/settings/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ use crate::Element;
use std::borrow::Cow;

/// 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> {
Section {
title: title.into(),
children: ListColumn::default(),
}
}

/// 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.
pub fn with_column<'a, Message: 'static>(
children: ListColumn<'a, Message>,
Expand Down

0 comments on commit af68a3f

Please sign in to comment.