Use navigation bar for image editor buttons.

This commit is contained in:
Matthew Chen 2019-02-28 12:37:07 -05:00
parent e47ceab41c
commit 00aa5be55d

View file

@ -40,6 +40,7 @@ public class ImageEditorView: UIView {
updateButtons()
updateGestureState()
delegate?.imageEditorUpdateNavigationBar()
}
}
@ -264,10 +265,17 @@ public class ImageEditorView: UIView {
let captionButton = navigationBarButton(imageName: "image_editor_caption",
selector: #selector(didTapCaption(sender:)))
if model.canUndo() {
return [undoButton, newTextButton, brushButton, cropButton, captionButton]
} else {
return [newTextButton, brushButton, cropButton, captionButton]
switch editorMode {
case .text:
return []
case .brush:
return []
case .none:
if model.canUndo() {
return [undoButton, newTextButton, brushButton, cropButton, captionButton]
} else {
return [newTextButton, brushButton, cropButton, captionButton]
}
}
}