Skip to content

Commit

Permalink
Fix documentation and prevent breaking API
Browse files Browse the repository at this point in the history
Deprecating: `load_with_default_open` as the arguments already infer
that's the case
  • Loading branch information
Norlock committed Nov 19, 2023
1 parent 85b6b1a commit 685d6fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/egui/src/containers/collapsing_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ impl CollapsingState {
})
}

#[deprecated = "use load instead"]
pub fn load_with_default_open(ctx: &Context, id: Id, default_open: bool) -> Self {
Self::load_with_default_open(ctx, id, default_open)
}

pub fn is_open(&self) -> bool {
self.state.open
}
Expand Down Expand Up @@ -149,7 +154,7 @@ impl CollapsingState {
/// ```
/// # egui::__run_test_ui(|ui| {
/// let id = ui.make_persistent_id("my_collapsing_header");
/// egui::collapsing_header::CollapsingState::load_with_default_open(ui.ctx(), id, false)
/// egui::collapsing_header::CollapsingState::load(ui.ctx(), id, false)
/// .show_header(ui, |ui| {
/// ui.label("Header"); // you can put checkboxes or whatever here
/// })
Expand Down Expand Up @@ -256,7 +261,7 @@ impl CollapsingState {
/// ui.painter().circle_filled(response.rect.center(), radius, stroke.color);
/// }
///
/// let mut state = egui::collapsing_header::CollapsingState::load_with_default_open(
/// let mut state = egui::collapsing_header::CollapsingState::load(
/// ui.ctx(),
/// ui.make_persistent_id("my_collapsing_state"),
/// false,
Expand Down

0 comments on commit 685d6fb

Please sign in to comment.