Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
image-buffer: add help on ? and C-h
  • Loading branch information
vindarel committed Jul 21, 2023
commit f2ade4c627cd8347b11c7909f3ba9e9da82ed6c8
9 changes: 9 additions & 0 deletions frontends/sdl2/image-buffer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
(define-key *image-viewer-keymap* "C-+" 'image-zoom-in)
(define-key *image-viewer-keymap* "C--" 'image-zoom-out)
(define-key *image-viewer-keymap* "C-0" 'image-zoom-reset)
(define-key *image-viewer-keymap* "?" 'image-zoom-help)
(define-key *image-viewer-keymap* "C-h" 'image-zoom-help)

(defmethod render :before (texture window (buffer image-buffer))
(sdl2:set-render-target (current-renderer) texture)
Expand Down Expand Up @@ -76,6 +78,13 @@
(define-command image-zoom-reset () ()
(reset-buffer-scale (current-buffer)))

(define-command image-zoom-help () ()
(with-pop-up-typeout-window (s (make-buffer "*image-zoom-help*") :erase t)
(format s "Open an image file in Lem and use these keys to zoom in and out:~&")
(format s "Zoom in: C - + (M-x image-zoom-in)~&")
(format s "Zoom out: C - - (M-x image-zoom-out)~&")
(format s "Zoom reset: C - 0 (M-x image-zoom-reset)~&")))

(defclass sdl2-find-file-executor (lem:find-file-executor) ())

(defmethod lem:execute-find-file ((executor sdl2-find-file-executor) mode pathname)
Expand Down