From 7812c77cf39e11ca7855bb132deb55b74f4bc556 Mon Sep 17 00:00:00 2001 From: pierrevbc <101216765+pierrevbc@users.noreply.github.com> Date: Mon, 12 Oct 2026 15:49:27 +0200 Subject: [PATCH] Title bar: Export button next to Save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Export dialog had no visible control: the native menu bar that lists Export… is not installed, so only the command palette reached it. The quick access row now has an Export button (the existing Export icon) that opens the export dialog, enabled when a presentation is open. --- crates/ui-egui/src/lib.rs | 22 ++++++++++++++++++++++ crates/ui-egui/src/ribbon.rs | 3 +++ 2 files changed, 25 insertions(+) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index ec97e6e6..22ad8f19 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1299,6 +1299,28 @@ mod tests { assert!(size(&mut harness).unwrap_or(f64::MAX) < after, "Ctrl+[ shrinks"); } + /// Export… had no visible control: only the command palette reached it. + #[test] + fn title_bar_export_opens_the_export_dialog() { + let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_ui_state( + |ui, app: &mut SlideApp| { + app.logic(ui.ctx()); + app.ui(ui); + }, + SlideApp::new(Session::with_new(), Services::default()), + ); + harness.run_steps(2); + assert!(harness.state().dialog.is_none()); + // Quick access: Home, Save, Export, each 24 points wide with 2 between, from x = 10. + let pos = egui::pos2(10.0 + 2.0 * 26.0 + 12.0, ribbon::TITLE_H / 2.0); + harness.hover_at(pos); + harness.run_steps(1); + harness.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::NONE }); + harness.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed: false, modifiers: egui::Modifiers::NONE }); + harness.run_steps(2); + assert_eq!(harness.state().dialog.as_ref().map(|d| d.id.as_str()), Some("export")); + } + #[test] fn home_needs_an_open_presentation() { let mut app = SlideApp::new(Session::new(), Services::default()); diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 8e847928..cf065954 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -53,6 +53,9 @@ pub fn title_bar(app: &mut SlideApp, ui: &mut Ui) { if icon_toggle(&mut child, Icon::Save, "Save (⌘S)", has_doc, false).clicked() { app.save(); } + if icon_toggle(&mut child, Icon::Export, "Export…", has_doc, false).clicked() { + let _ = app.run("app.exportDialog", json!({})); + } if icon_toggle(&mut child, Icon::Undo, "Undo (⌘Z)", enabled(app, "edit.undo"), false).clicked() { run(app, "edit.undo", json!({})); }