Merge pull request #1769 from TrevorBrown-dev/fix/variables-header-gap

M7: a gap between Import and Export in the Local variables window (#1754)
This commit is contained in:
BFlat
2026-11-07 12:31:42 +08:00
committed by GitHub
@@ -288,6 +288,9 @@ fn header(app: &mut FigApp, ui: &mut Ui, open: &mut bool) {
// Import and export, left of Close.
let bar = Rect::from_min_max(pos2(r.max.x - 280.0, r.min.y + 10.0), pos2(r.max.x - 40.0, r.max.y - 10.0));
let mut bar = ui.new_child(UiBuilder::new().max_rect(bar).layout(egui::Layout::right_to_left(egui::Align::Center)));
// The window lays itself out without item spacing (set by the caller); the buttons in this bar
// keep the same gap between them as the one between Export and the Close button (#1754).
bar.spacing_mut().item_spacing.x = 16.0;
let export = widgets::button(&mut bar, tr("Export…"), false, true);
crate::right::menu_popup(&export).show(|ui| {
for (label, format) in [(tr("Variables JSON…"), "json"), (tr("CSS custom properties…"), "css"), (tr("Dart constants for Flutter…"), "dart")]