Repository navigation
Image Properties: add a Copy button to copy image info to the clipboard - #247
Merged
Merged
Conversation
Add a "Copy" button to the Image Properties dialog, next to "Close", that copies everything the dialog currently shows for the selected image to the clipboard as plain text: - General properties: name, width, height, type, size and folder. - EXIF and XMP summary fields, when metadata is available. - The full metadata "Details" tree, one tag per line, with nesting indicated by leading tabs and tag/value separated by a tab. Empty categories are skipped. Metadata is only included while the metadata section is visible, since its labels otherwise still hold values from the previously shown image. Ctrl+C in the dialog triggers the same copy, unless the focused label has a text selection, in which case the normal label copy is kept. A new internal helper, xviewer_metadata_details_get_text(), serializes the details tree model. Co-Authored-By: Claude Opus 5.5
- Close already uses C for its mnemonic. - Copy doesn't belong grouped in between navigation/close buttons.
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.
Summary
Adds a Copy button to the Image Properties dialog (between the navigation buttons and Close) that puts all the information the dialog is showing for the current image on the clipboard as plain text. This makes it easy to paste image details into a bug report, forum post, spreadsheet or notes, without selecting labels one by one.
What gets copied
Empty fields are left out. Labels use the existing translated strings, so the copied text follows the UI language.
Example output:
Keyboard shortcut
Ctrl+C in the dialog does the same thing. If the focused label has a text selection, Ctrl+C keeps its normal behaviour and copies only the selection.
Implementation notes
xviewer-image-properties-dialog.ui: newcopy_button; the Close button moves from position 2 to 3.xviewer-metadata-details.[ch]: new internalxviewer_metadata_details_get_text(), which walks the detailsGtkTreeModelrecursively and returns tab-separated text.xviewer-properties-dialog.c: builds the text from the dialog's labels and the details view, sets it onGDK_SELECTION_CLIPBOARD, adds a tooltip on the button, and handles Ctrl+C with akey-press-eventhandler.metadata_boxis visible.HAVE_METADATA/HAVE_EXIF/HAVE_EXEMPIguards, so builds without those libraries still work.Translatable strings
Copy the image properties to the clipboard(button tooltip)_Copy,DetailsTesting
🤖 Generated with Claude Code