Skip to content

feature: Add CTRL+G shortcut to focus selected label#243

Merged
GreatV merged 2 commits intoPFCCLab:mainfrom
MuhammedOzdogan:feature/242-focus-label-shortcut
Mar 23, 2026
Merged

feature: Add CTRL+G shortcut to focus selected label#243
GreatV merged 2 commits intoPFCCLab:mainfrom
MuhammedOzdogan:feature/242-focus-label-shortcut

Conversation

@MuhammedOzdogan
Copy link
Contributor

Added a new hotkey (CTRL+G) that automatically pans and zooms the canvas to center on the bounding box of the currently selected label in the right-side panel. This eliminates the need to manually scan dense images to locate a label.

Resolves #242

Added a new hotkey (CTRL+G) that automatically pans and zooms
the canvas to center on the bounding box of the currently
selected label in the right-side panel. This eliminates the
need to manually scan dense images to locate a label.

Resolves PFCCLab#242
@MuhammedOzdogan
Copy link
Contributor Author

Here is a video recording about the feature:

ppocrlabel_focus_and_zoom.mp4

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new navigation hotkey (Ctrl+G) to quickly pan/zoom the canvas onto the currently selected label’s bounding box, improving usability when working with dense annotations (resolves #242).

Changes:

  • Introduces a new focusAndZoom QAction bound to Ctrl+G, added to label list context menu and edit menus.
  • Implements MainWindow.focusAndZoom() to compute a target zoom and center the scroll area on the selected shape.
  • Updates user-facing strings and documentation (EN/ZH), plus regenerated Qt resources.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
PPOCRLabel.py Adds the Ctrl+G action, wires it into menus, and implements the focus/zoom behavior.
libs/utils.py Updates shortcut help text to include Ctrl+G (EN/ZH) and fixes some newline formatting.
resources/strings/strings-en.properties Adds localized strings for the new action.
resources/strings/strings-zh-CN.properties Adds localized strings for the new action.
README.md Documents the new Ctrl+G shortcut.
README_ch.md Documents the new Ctrl+G shortcut (Chinese).
libs/resources.py Regenerated embedded resource blob to include new strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@GreatV GreatV left a comment

Choose a reason for hiding this comment

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

LGTM

@GreatV GreatV merged commit 3218a7d into PFCCLab:main Mar 23, 2026
1 check passed
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 Request] Add shortcut to zoom and focus on selected label from the Labels Panel (e.g., CTRL+G)

3 participants