Skip to content

feat(desktop): add "Reset Zoom" item to the Window menu - #5185

Open
xrgzs wants to merge 1 commit into
marktext:developfrom
xrgzs:reset-zoom
Open

feat(desktop): add "Reset Zoom" item to the Window menu#5185
xrgzs wants to merge 1 commit into
marktext:developfrom
xrgzs:reset-zoom

Conversation

@xrgzs

@xrgzs xrgzs commented Aug 25, 2026

Copy link
Copy Markdown

Closes #5184

Summary

Add a Reset Zoom item to the Window menu, between "Zoom Out" and the separator.
It restores the window zoom factor to 1.0 by reusing the existing mt::window-zoom
IPC channel (same workaround as Zoom In/Out for Electron#16018), and is registered
as a window.resetZoom command so it can be rebound in preferences.

  • New action: resetZoom in src/main/windows/utils.ts
  • New command id: WINDOW_ZOOM_RESET (window.resetZoom) in src/common/commands/constants.ts
  • Menu entry added in src/main/menu/templates/window.ts with i18n labels
    (menu.window.resetZoom) for all 10 locales

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • New tests added (or explain why not needed) - not needed: follows the exact
    pattern of the existing Zoom In/Out menu items; behavior verified by typecheck
    and manual testing.
  • Manually tested on:

Notes for reviewers [optional]

  • No default accelerator is assigned. Ctrl+0/Cmd+0 are already taken
    (tabs.switchToTenth on Win/Linux, paragraph.paragraph on macOS), so the
    keybinding ships empty like window.zoomIn/window.zoomOut and can be
    customized in preferences.
  • Reset always targets 1.0, matching Electron's built-in resetZoom role behavior.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add "Reset Zoom" item to the Window menu

1 participant