feature: Add CTRL+G shortcut to focus selected label#243
Merged
GreatV merged 2 commits intoPFCCLab:mainfrom Mar 23, 2026
Merged
feature: Add CTRL+G shortcut to focus selected label#243GreatV merged 2 commits intoPFCCLab:mainfrom
GreatV merged 2 commits intoPFCCLab:mainfrom
Conversation
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
Contributor
Author
|
Here is a video recording about the feature: ppocrlabel_focus_and_zoom.mp4 |
Contributor
There was a problem hiding this comment.
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
focusAndZoomQAction bound toCtrl+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.
…ith QTimer.singleShot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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