mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 03:17:43 +00:00
Give document tab strips with controls their available width
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user