Skip to content

Commit

Permalink
Better docs for Sides
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 1, 2024
1 parent d02b9bf commit 32695b3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/egui/src/containers/sides.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ use emath::Align;

use crate::{Layout, Ui, UiBuilder};

/// Put some widgets on the left and right side of the ui.
/// Put some widgets on the left and right sides of a ui.
///
/// The result will look like this:
/// ```text
/// ________________________________________________
/// | left widgets -> | gap | <- right widgets |
/// parent Ui
/// ______________________________________________________
/// | | | | ^
/// | -> left widgets -> | gap | <- right widgets <- | | height
/// |____________________|___________|_____________________| v
/// | |
/// | |
/// ```
///
/// The gap will be as small as possible, but will grow if the left and right widgets overlap.
/// The width of the gap is dynamic, based on the max width of the parent [`Ui`].
/// When the parent is being auto-sized ([`Ui::is_sizing_pass`]) the gap will be as small as possible.
///
/// If the parent is not wide enough to fit all widgets, the parent will be expanded to the right.
///
/// The left widgets are first added to the ui, left-to-right.
/// Then the right widgets are added, right-to-left.
Expand Down

0 comments on commit 32695b3

Please sign in to comment.