Skip to content

feat: Include command/control-0 for OriginalSize in StandardKeyBindings#220

Merged
tlambert03 merged 1 commit intopyapp-kit:mainfrom
psobolewskiPhD:add_original_size_binding
Aug 17, 2024
Merged

feat: Include command/control-0 for OriginalSize in StandardKeyBindings#220
tlambert03 merged 1 commit intopyapp-kit:mainfrom
psobolewskiPhD:add_original_size_binding

Conversation

@psobolewskiPhD
Copy link
Copy Markdown
Contributor

I just discovered the very cool StandardKeyBindings while adding Zoom keybindings in napari.
In this PR I'm just adding the command/control-0 to reset zoom as a standard keybinding, sometimes called OriginalSize (Qt), Actual Size (macOS), etc. but a consistent pattern on macOS and Windows and in Qt (https://doc.qt.io/qtcreator/creator-keyboard-shortcuts.html#image-viewer-shortcuts).

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4afa6f6) to head (1c1c4ea).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #220   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines         1870      1871    +1     
=========================================
+ Hits          1870      1871    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlambert03 tlambert03 merged commit b7cd0d5 into pyapp-kit:main Aug 17, 2024
@DragaDoncila
Copy link
Copy Markdown
Contributor

@tlambert03 it would be nice to have this PR released so we can merge a related PR in napari. Any chance of an app-model release soonish?

@tlambert03 tlambert03 added the enhancement New feature or request label Sep 17, 2024
@tlambert03
Copy link
Copy Markdown
Member

just pushed v0.3.0, lemme know if the release fails for any reason

jni pushed a commit to napari/napari that referenced this pull request Sep 23, 2024
# References and relevant issues

Closes #4855

# Description

This PR adds menu items and "standard keybindings" for Zoom in, Zoom
out, and Reset Zoom to the View menu.
The keybindings are Qt defaults
(https://doc.qt.io/qtcreator/creator-keyboard-shortcuts.html#image-viewer-shortcuts),
as well as defaults on macOS and Windows (see e.g. Adobe Photoshop or
Chrome)
Note: I've made a PR to app-model to add the Reset Zoom standard
keybinding (pyapp-kit/app-model#220) so if that
is merged I can edit this PR to use that here too!

I added to a test for the new behavior.

Note, this approach does not present these as editable in the napari
Preferences. I
These are bound like an OS default would be, e.g. copy, paste, etc. They
are editable on the OS level at least on macOS.

---------

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants