Skip to content

Commit

Permalink
Ctrl+C to copy an image, Ctrl+Shift+C to copy its path
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom94 committed Feb 2, 2023
1 parent bd0f7f0 commit dd5f9ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/HelpWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ HelpWindow::HelpWindow(Widget* parent, bool supportsHdr, function<void()> closeC
addRow(imageLoading, COMMAND + "+Shift+R or " + COMMAND + "+F5", "Reload all images");
addRow(imageLoading, COMMAND + "+W", "Close image");
addRow(imageLoading, COMMAND + "+Shift+W", "Close all images");
addRow(imageLoading, COMMAND + "+C", "Copy image or path to clipboard");
addRow(imageLoading, COMMAND + "+C", "Copy image to clipboard");
addRow(imageLoading, COMMAND + "+Shift+C", "Copy image's path to clipboard");
addRow(imageLoading, COMMAND + "+V", "Paste image from clipboard");

new Label{shortcuts, "Image options", "sans-bold", 18};
Expand Down
2 changes: 1 addition & 1 deletion src/ImageViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ bool ImageViewer::keyboard_event(int key, int scancode, int action, int modifier
set_visible(false);
return true;
} else if (mCurrentImage && key == GLFW_KEY_C && (modifiers & SYSTEM_COMMAND_MOD)) {
if (mImageScrollContainer->focused()) {
if (modifiers & GLFW_MOD_SHIFT) {
if (clip::set_text(mCurrentImage->name())) {
tlog::success() << "Image path copied to clipboard.";
} else {
Expand Down

0 comments on commit dd5f9ef

Please sign in to comment.