|
@@ -209,19 +209,34 @@ class KMToolbarController: NSViewController {
|
|
|
secondaryToolBarBox.isHidden = true
|
|
|
secondaryToolBarHeight.constant = 51
|
|
|
let mainToolbarH = self.mainToolBarisVisable ? Self.mainToolBarHeight : 0
|
|
|
- if _toolbarType == .None {
|
|
|
- bottomOffset.constant = 0
|
|
|
- childToolBarBox.isHidden = true
|
|
|
- self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH, animated: false)
|
|
|
- } else if _toolbarType == .Page || _toolbarType == .LeftPanel || _toolbarType == .redact {
|
|
|
- bottomOffset.constant = 0
|
|
|
- childToolBarBox.isHidden = true
|
|
|
- self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH, animated: false)
|
|
|
+ if self.mainViewController!.isReadMode {
|
|
|
+ if (_toolbarType == .Annatiton) {
|
|
|
+ let childToolbarH = Self.childToolBarHeightValue
|
|
|
+ bottomOffset.constant = childToolbarH.cgFloat
|
|
|
+ mainToolBarHeight.constant = 0
|
|
|
+ childToolBarBox.isHidden = false
|
|
|
+ self.delegate?.toolbarController?(self, heightOffsetChange: 41, animated: false)
|
|
|
+ } else {
|
|
|
+ mainToolBarHeight.constant = 0
|
|
|
+ bottomOffset.constant = 0
|
|
|
+ childToolBarBox.isHidden = true
|
|
|
+ self.delegate?.toolbarController?(self, heightOffsetChange: 0, animated: false)
|
|
|
+ }
|
|
|
} else {
|
|
|
- let childToolbarH = Self.childToolBarHeightValue
|
|
|
- bottomOffset.constant = childToolbarH.cgFloat
|
|
|
- childToolBarBox.isHidden = false
|
|
|
- self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH + childToolbarH, animated: false)
|
|
|
+ if _toolbarType == .None {
|
|
|
+ bottomOffset.constant = 0
|
|
|
+ childToolBarBox.isHidden = true
|
|
|
+ self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH, animated: false)
|
|
|
+ } else if _toolbarType == .Page || _toolbarType == .LeftPanel || _toolbarType == .redact {
|
|
|
+ bottomOffset.constant = 0
|
|
|
+ childToolBarBox.isHidden = true
|
|
|
+ self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH, animated: false)
|
|
|
+ } else {
|
|
|
+ let childToolbarH = Self.childToolBarHeightValue
|
|
|
+ bottomOffset.constant = childToolbarH.cgFloat
|
|
|
+ childToolBarBox.isHidden = false
|
|
|
+ self.delegate?.toolbarController?(self, heightOffsetChange: mainToolbarH + childToolbarH, animated: false)
|
|
|
+ }
|
|
|
}
|
|
|
childToolBarView?.toolbarType = _toolbarType
|
|
|
childToolBarView?.reloadateToolbar()
|