|
@@ -2053,52 +2053,46 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
}
|
|
}
|
|
var count = 0
|
|
var count = 0
|
|
for section in self.annotations {
|
|
for section in self.annotations {
|
|
- if section.annotations?.count != 0 {
|
|
|
|
- count += section.annotations!.count
|
|
|
|
|
|
+ if let cnt = section.annotations?.count {
|
|
|
|
+ count += cnt
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// if (item == nil){
|
|
|
|
-// NSInteger count = [[rightSideController.noteArrayController arrangedObjects] count];
|
|
|
|
|
|
+ if (self.allAnnotations.count < 1) {
|
|
|
|
+ self.noteSearchButton.isEnabled = false
|
|
|
|
+ self.noteFilterButton.isEnabled = false
|
|
|
|
+ } else {
|
|
|
|
+ self.noteSearchButton.isEnabled = true
|
|
|
|
+ self.noteFilterButton.isEnabled = true
|
|
|
|
+ }
|
|
|
|
+ if count < 1 {
|
|
|
|
+ self.noteOutlineView.usesAlternatingRowBackgroundColors = false
|
|
|
|
+ let view = self.noteOutlineView.enclosingScrollView
|
|
|
|
+ let viewFrame = view?.frame ?? .zero
|
|
|
|
+ var emptyVcSize = self.leftSideEmptyVC.emptyAnnotationView.frame.size
|
|
|
|
+ self.leftSideEmptyVC.emptyAnnotationView.frame = NSMakeRect((viewFrame.size.width-emptyVcSize.width)/2.0,(viewFrame.size.height-emptyVcSize.height)/2.0, emptyVcSize.width, emptyVcSize.height)
|
|
|
|
|
|
- if (count < 1) {
|
|
|
|
-// if (notes.count < 1) {
|
|
|
|
- self.noteSearchButton.isEnabled = false
|
|
|
|
- self.noteFilterButton.isEnabled = false
|
|
|
|
-// }
|
|
|
|
- self.noteOutlineView.usesAlternatingRowBackgroundColors = false
|
|
|
|
- let view = self.noteOutlineView.enclosingScrollView
|
|
|
|
- let viewFrame = view?.frame ?? .zero
|
|
|
|
- var emptyVcSize = self.leftSideEmptyVC.emptyAnnotationView.frame.size
|
|
|
|
- self.leftSideEmptyVC.emptyAnnotationView.frame = NSMakeRect((viewFrame.size.width-emptyVcSize.width)/2.0,(viewFrame.size.height-emptyVcSize.height)/2.0, emptyVcSize.width, emptyVcSize.height)
|
|
|
|
-
|
|
|
|
- self.leftSideEmptyVC.emptyAnnotationView.autoresizingMask = [.minXMargin, .maxXMargin, .minYMargin, .maxYMargin]
|
|
|
|
- self.noteOutlineView.enclosingScrollView?.documentView?.addSubview(self.leftSideEmptyVC.emptyAnnotationView)
|
|
|
|
- self.leftSideEmptyVC.exportAnnotationBtn.isEnabled = false
|
|
|
|
- self.leftSideEmptyVC.deleteAnnotationBtn.isEnabled = false
|
|
|
|
-//
|
|
|
|
- if (self.leftView.segmentedControl.selectedSegment == KMSelectedSegmentType.annotation.rawValue) {
|
|
|
|
- self.noteHeaderView.isHidden = true
|
|
|
|
- self.toolButtonBoxLayoutConstraint.constant = 40.0
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- self.noteSearchButton.isEnabled = true
|
|
|
|
- self.noteFilterButton.isEnabled = true
|
|
|
|
-
|
|
|
|
- self.noteOutlineView.usesAlternatingRowBackgroundColors = false
|
|
|
|
-
|
|
|
|
- self.leftSideEmptyVC.emptyAnnotationView.removeFromSuperview()
|
|
|
|
- self.leftSideEmptyVC.exportAnnotationBtn.isEnabled = true
|
|
|
|
- self.leftSideEmptyVC.deleteAnnotationBtn.isEnabled = true
|
|
|
|
-//
|
|
|
|
- if (self.leftView.segmentedControl.selectedSegment == KMSelectedSegmentType.annotation.rawValue) {
|
|
|
|
- self.noteHeaderView.isHidden = false
|
|
|
|
- self.toolButtonBoxLayoutConstraint.constant = 64.0
|
|
|
|
- }
|
|
|
|
|
|
+ self.leftSideEmptyVC.emptyAnnotationView.autoresizingMask = [.minXMargin, .maxXMargin, .minYMargin, .maxYMargin]
|
|
|
|
+ self.noteOutlineView.enclosingScrollView?.documentView?.addSubview(self.leftSideEmptyVC.emptyAnnotationView)
|
|
|
|
+ self.leftSideEmptyVC.exportAnnotationBtn.isEnabled = false
|
|
|
|
+ self.leftSideEmptyVC.deleteAnnotationBtn.isEnabled = false
|
|
|
|
+
|
|
|
|
+ if (self.leftView.segmentedControl.selectedSegment == KMSelectedSegmentType.annotation.rawValue) {
|
|
|
|
+ self.noteHeaderView.isHidden = true
|
|
|
|
+ self.toolButtonBoxLayoutConstraint.constant = 40.0
|
|
}
|
|
}
|
|
- return count
|
|
|
|
-// } else {
|
|
|
|
-// return [item hasNoteText];
|
|
|
|
-// }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ self.noteOutlineView.usesAlternatingRowBackgroundColors = false
|
|
|
|
+
|
|
|
|
+ self.leftSideEmptyVC.emptyAnnotationView.removeFromSuperview()
|
|
|
|
+ self.leftSideEmptyVC.exportAnnotationBtn.isEnabled = true
|
|
|
|
+ self.leftSideEmptyVC.deleteAnnotationBtn.isEnabled = true
|
|
|
|
+ if (self.leftView.segmentedControl.selectedSegment == KMSelectedSegmentType.annotation.rawValue) {
|
|
|
|
+ self.noteHeaderView.isHidden = false
|
|
|
|
+ self.toolButtonBoxLayoutConstraint.constant = 64.0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return count
|
|
}
|
|
}
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|