Skip to content

Commit

Permalink
Merge pull request #170 from Tom94/command-q-to-quit
Browse files Browse the repository at this point in the history
Quit with Ctrl/Cmd+Q rather than Q or Esc
  • Loading branch information
Tom94 authored Jan 16, 2022
2 parents edaa957 + 2d34379 commit 6685cdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/HelpWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ HelpWindow::HelpWindow(Widget *parent, bool supportsHdr, function<void()> closeC
addRow(ui, COMMAND + "+B", "Toggle GUI");
addRow(ui, "H", "Show Help (this Window)");
addRow(ui, COMMAND + "+P", "Find Image or Channel Group");
addRow(ui, "Q or Esc", "Quit");
addRow(ui, COMMAND + "+Q", "Quit");
}

// About tab
Expand Down
10 changes: 5 additions & 5 deletions src/ImageViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,15 @@ bool ImageViewer::keyboard_event(int key, int scancode, int action, int modifier
resetImage();
}
return true;
} else if (key == GLFW_KEY_B && modifiers & SYSTEM_COMMAND_MOD) {
} else if (key == GLFW_KEY_B && (modifiers & SYSTEM_COMMAND_MOD)) {
setUiVisible(!isUiVisible());
} else if (key == GLFW_KEY_O && modifiers & SYSTEM_COMMAND_MOD) {
} else if (key == GLFW_KEY_O && (modifiers & SYSTEM_COMMAND_MOD)) {
openImageDialog();
return true;
} else if (key == GLFW_KEY_S && modifiers & SYSTEM_COMMAND_MOD) {
} else if (key == GLFW_KEY_S && (modifiers & SYSTEM_COMMAND_MOD)) {
saveImageDialog();
return true;
} else if (key == GLFW_KEY_P && modifiers & SYSTEM_COMMAND_MOD) {
} else if (key == GLFW_KEY_P && (modifiers & SYSTEM_COMMAND_MOD)) {
mFilter->request_focus();
return true;
} else if (key == GLFW_KEY_F) {
Expand Down Expand Up @@ -696,7 +696,7 @@ bool ImageViewer::keyboard_event(int key, int scancode, int action, int modifier
mClipToLdrButton->set_pushed(!mClipToLdrButton->pushed());
mImageCanvas->setClipToLdr(mClipToLdrButton->pushed());
return true;
} else if (key == GLFW_KEY_ESCAPE || key == GLFW_KEY_Q) {
} else if (key == GLFW_KEY_Q && (modifiers & SYSTEM_COMMAND_MOD)) {
set_visible(false);
return true;
} else if (mCurrentImage && key == GLFW_KEY_C && (modifiers & SYSTEM_COMMAND_MOD)) {
Expand Down

0 comments on commit 6685cdc

Please sign in to comment.