Titled group header: title and close button centred on the header line

This commit is contained in:
Dylan M. Taylor
2026-11-22 12:56:47 -05:00
parent 9e8287c5fc
commit 5837a568d6
+2 -1
View File
@@ -498,7 +498,8 @@ impl<P: Clone + Hash + Send + Sync + 'static> Container for DockGroup<'_, P> {
let reported = &mut self.reported;
let drags = crate::runtime::drag::started(ui.ctx());
let ctx = ui.ctx().clone();
let layout = if rtl { egui::Layout::right_to_left(egui::Align::Min) } else { egui::Layout::left_to_right(egui::Align::Min) };
let cross = if titled { egui::Align::Center } else { egui::Align::Min };
let layout = if rtl { egui::Layout::right_to_left(cross) } else { egui::Layout::left_to_right(cross) };
ui.with_layout(layout, |ui| {
ui.spacing_mut().item_spacing.x = gap; // design: allow[style-mutation](the header lays its title cells with an egui layout and sets that layout's gap)
let shown = panels.iter().find(|panel| panel.key == active);