Merge pull request #681 from j-f1/there-is-no-escape
Allow pressing escape to close the media viewer
This commit is contained in:
commit
fba444d82f
|
@ -359,12 +359,12 @@ extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
|
||||||
|
|
||||||
extension MediaPreviewViewController {
|
extension MediaPreviewViewController {
|
||||||
|
|
||||||
var closeKeyCommand: UIKeyCommand {
|
func closeKeyCommand(input: String) -> UIKeyCommand {
|
||||||
UIKeyCommand(
|
UIKeyCommand(
|
||||||
title: L10n.Scene.Preview.Keyboard.closePreview,
|
title: L10n.Scene.Preview.Keyboard.closePreview,
|
||||||
image: nil,
|
image: nil,
|
||||||
action: #selector(MediaPreviewViewController.closePreviewKeyCommandHandler(_:)),
|
action: #selector(MediaPreviewViewController.closePreviewKeyCommandHandler(_:)),
|
||||||
input: "i",
|
input: input,
|
||||||
modifierFlags: [],
|
modifierFlags: [],
|
||||||
propertyList: nil,
|
propertyList: nil,
|
||||||
alternates: [],
|
alternates: [],
|
||||||
|
@ -408,7 +408,8 @@ extension MediaPreviewViewController {
|
||||||
|
|
||||||
override var keyCommands: [UIKeyCommand] {
|
override var keyCommands: [UIKeyCommand] {
|
||||||
return [
|
return [
|
||||||
closeKeyCommand,
|
closeKeyCommand(input: UIKeyCommand.inputEscape),
|
||||||
|
closeKeyCommand(input: "i"),
|
||||||
showNextKeyCommand,
|
showNextKeyCommand,
|
||||||
showPreviousKeyCommand,
|
showPreviousKeyCommand,
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue