diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index e8effc5e..e8ccaf57 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -101,7 +101,7 @@ impl State { } /// Paint the arrow icon that indicated if the region is open or not -pub fn paint_icon(ui: &mut Ui, openness: f32, response: &Response) { +pub(crate) fn paint_icon(ui: &mut Ui, openness: f32, response: &Response) { let stroke = ui.style().interact(response).fg_stroke; let rect = response.rect; @@ -118,7 +118,7 @@ pub fn paint_icon(ui: &mut Ui, openness: f32, response: &Response) { ui.painter().add(PaintCmd::closed_line(points, stroke)); } -/// A header which can be collapsed/expanded, revealing a contained `Ui` region. +/// A header which can be collapsed/expanded, revealing a contained [`Ui`] region. pub struct CollapsingHeader { label: Label, default_open: bool, @@ -269,6 +269,7 @@ impl CollapsingHeader { } } +/// The response from showing a [`CollapsingHeader`]. pub struct CollapsingResponse { pub header_response: Response, /// None iff collapsed. diff --git a/egui/src/containers/combo_box.rs b/egui/src/containers/combo_box.rs index 5ea44b26..49a11843 100644 --- a/egui/src/containers/combo_box.rs +++ b/egui/src/containers/combo_box.rs @@ -1,5 +1,20 @@ use crate::{paint::PaintCmd, style::WidgetVisuals, *}; +/// A drop-down selection menu with a descriptive label. +/// +/// See also [`combo_box`]. +/// +/// ``` +/// # #[derive(Debug, PartialEq)] +/// # enum Enum { First, Second, Third } +/// # let mut selected = Enum::First; +/// # let mut ui = &mut egui::Ui::__test(); +/// egui::combo_box_with_label(ui, "Select one!", format!("{:?}", selected), |ui| { +/// ui.selectable_value(&mut selected, Enum::First, "First"); +/// ui.selectable_value(&mut selected, Enum::Second, "Second"); +/// ui.selectable_value(&mut selected, Enum::Third, "Third"); +/// }); +/// ``` pub fn combo_box_with_label( ui: &mut Ui, label: impl Into