1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

egui_extras: Improve the auto-sizing of Table (#4756)

This makes the sizing pass of an `egui_table` ensure the table uses as
little width as possible.
Subsequently, it will redistribute all non-resizable columns on the
available space, so that a table better follow the parent container as
it is resized.

I also added `table.reset()` for forgetting the current column widths.
This commit is contained in:
Emil Ernerfeldt
2024-07-02 21:13:55 +02:00
committed by GitHub
parent 753412193c
commit 8ef0e85b85
4 changed files with 119 additions and 41 deletions

View File

@@ -68,6 +68,14 @@ impl Label {
self
}
/// Set [`Self::wrap_mode`] to [`TextWrapMode::Extend`],
/// disabling wrapping and truncating, and instead expanding the parent [`Ui`].
#[inline]
pub fn extend(mut self) -> Self {
self.wrap_mode = Some(TextWrapMode::Extend);
self
}
/// Can the user select the text with the mouse?
///
/// Overrides [`crate::style::Interaction::selectable_labels`].