Use navigation bar for image editor buttons.

pull/2/head
Matthew Chen 6 years ago
parent e47ceab41c
commit 00aa5be55d

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

Loading…
Cancel
Save