Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shift + [1-5] keyboard shortcuts to zoom out #50498

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

AaronRecord
Copy link
Contributor

@AaronRecord AaronRecord commented Jul 15, 2021

While testing #48252, it occurred to me it'd probably be useful to be able to zoom out quickly as well, for tilemaps/wordbuilding etc.
shift + 1: zoom to 50%
shift + 2: zoom to 25%
shift + 3: zoom to 12.5%
shift + 4: zoom to 6.25%
shift + 5: zoom to 3.125%

3.x version here: #50499

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

I didn't think about this at first, but it seems like a good idea to me.

Maybe GIMP could do the same eventually… 👀

My only concern is that web browsers use Alt + (number key) to switch between tabs, and we may want to implement this in Godot eventually. If we go forward with this, we may have to replace the use of Alt with another modifier such as Ctrl or Shift. However, holding Shift may be required to trigger the number keys in the first place on non-QWERTY keyboard layouts.

@AaronRecord
Copy link
Contributor Author

AaronRecord commented Jul 15, 2021

Maybe GIMP could do the same eventually… 👀

Haha, possibly, although I think it makes more sense in the context of Godot because in Gimp you generally work mainly in one area that you can see all of when you're at 100% zoom, but in Godot your scenes often take up more than one full screen.

@timothyqiu
Copy link
Member

FYI: Alt+[1-4] are used to open different editor workspaces on macOS:

godot/editor/editor_node.cpp

Lines 7013 to 7024 in 60add98

#ifdef OSX_ENABLED
ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_MASK_ALT | KEY_1);
ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_MASK_ALT | KEY_2);
ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_MASK_ALT | KEY_3);
ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library"), KEY_MASK_ALT | KEY_4);
#else
// Use the Ctrl modifier so F2 can be used to rename nodes in the scene tree dock.
ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_MASK_CTRL | KEY_F1);
ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_MASK_CTRL | KEY_F2);
ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_MASK_CTRL | KEY_F3);
ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library"), KEY_MASK_CTRL | KEY_F4);
#endif

@AaronRecord
Copy link
Contributor Author

@timothyqiu Maybe shift instead?

@timothyqiu
Copy link
Member

Yeah, GIMP uses Shift+2 to zoom to 50%. But personally, I have never triggered that successfully, and I don't know why 😓

@AaronRecord
Copy link
Contributor Author

AaronRecord commented Jul 16, 2021

Alright, I've changed it to use shift instead. Another alternative I considered was using [6-0] for zooming out, but I thought that wasn't the most intuitive because [1-5] gets more and more zoomed in and then after [6-0] it'd switch to getting more and more zoomed out. I also considered making 1 the most zoomed out and 0 the most zoomed in (so it gets more and more zoomed in as you go along), but this might be confusing to people coming from GIMP etc. shift isn't too bad though, I think it works fine.

@AaronRecord AaronRecord changed the title Add alt + [1-5] keyboard shortcuts to zoom out Add shift + [1-5] keyboard shortcuts to zoom out Jul 16, 2021
@akien-mga akien-mga merged commit 2f060df into godotengine:master Jul 20, 2021
@akien-mga
Copy link
Member

Thanks!

@AaronRecord AaronRecord deleted the zoom-out-alt-4.0 branch July 20, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants