From 01d2aa0ab4e31662b694a6c3691b2f63a45578b5 Mon Sep 17 00:00:00 2001 From: Brigham Toskin Date: Mon, 28 Oct 2019 21:29:33 -0400 Subject: [PATCH] Resolves #107: menu/accelerator for zoom-to-fit. --- frame.rkt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frame.rkt b/frame.rkt index 00917ab..d0aa873 100644 --- a/frame.rkt +++ b/frame.rkt @@ -562,6 +562,19 @@ (unless (equal? (image-path) +root-path+) (send (ivy-canvas) zoom-to 1.0)))])) +(define ivy-menu-bar-view-zoom-to-fit + (new menu-item% + [parent ivy-menu-bar-view-zoom] + [label "Fit"] + [help-string "Zoom the image to fit the window"] + [shortcut #\0] + [shortcut-prefix (list (if macosx? + 'option + 'alt))] + [callback (λ (i e) + (send (ivy-canvas) zoom-to-fit))])) + + (void (new separator-menu-item% [parent ivy-menu-bar-view-zoom]))