Give document tab strips with controls their available width

This commit is contained in:
Dylan M. Taylor
2026-11-21 13:26:04 -05:00
parent 35dfd1fe90
commit eed48a1fa6
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -147,8 +147,13 @@ fn a_document_tab_strip_in_the_bar_takes_the_free_width() {
Title::new("One.pdf"),
|ui, _| {
Button::new("Home").show(ui);
DocumentTabs::new("Documents", &tabs).reorderable(true).selected(0).show(ui);
Button::new("Open").show(ui);
DocumentTabs::new("Documents", &tabs)
.reorderable(true)
.selected(0)
.trailing(|ui| {
Button::new("Open").show(ui);
})
.show(ui);
},
|ui, _| {
Button::new("Settings").show(ui);
+1 -1
View File
@@ -332,7 +332,7 @@ impl<'a, D: Clone + Eq + Hash + Send + Sync + std::fmt::Debug + 'static> Documen
let mut shown = None;
// The row measures more than once to reserve non-filling children before sharing the
// remaining width. Recreate the strip and show both areas on every sweep.
let row = Row::new().show(ui, |ui, _| {
let row = Row::new().fill_width().show(ui, |ui, _| {
if let Some(area) = leading.as_mut() {
area(ui);
}