|
@@ -416,6 +416,7 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
|
|
|
private let MIN_SIDE_PANE_WIDTH: CGFloat = 270
|
|
|
private let LABEL_COLUMNID = "label"
|
|
|
+ var foldType: KMFoldAllAnnotationType = .none
|
|
|
|
|
|
override func loadView() {
|
|
|
super.loadView()
|
|
@@ -2873,32 +2874,34 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
// }
|
|
|
return cell
|
|
|
} else if outlineView.isEqual(to: self.noteOutlineView) {
|
|
|
-// if item is KMBOTAAnnotationItem {
|
|
|
+ if item is KMBOTAAnnotationItem {
|
|
|
// let cell : KMAnnotationOutlineCellView = KMAnnotationOutlineCellView.init()
|
|
|
-//// cell.delegate = self
|
|
|
+// cell.delegate = self
|
|
|
// cell.model = item as? KMBOTAAnnotationItem
|
|
|
// return cell
|
|
|
-// } else if item is KMBOTAAnnotationSection {
|
|
|
+ } else if item is KMBOTAAnnotationSection {
|
|
|
// let section = item as? KMBOTAAnnotationSection
|
|
|
//
|
|
|
// let cell : KMAnnotationOutlineSectionView = KMAnnotationOutlineSectionView.init()
|
|
|
// cell.model = section
|
|
|
// return cell
|
|
|
-// }
|
|
|
+ return nil
|
|
|
+ }
|
|
|
// return NSTableCellView()
|
|
|
|
|
|
-// PDFAnnotation *note = item;
|
|
|
+ let note = (item as! KMBOTAAnnotationItem).annotation!
|
|
|
let cell = outlineView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMNoteTableViewCell"), owner: self) as! KMNoteTableViewCell
|
|
|
-// cell.cellNote = note;
|
|
|
+ cell.cellNote = note
|
|
|
|
|
|
-//
|
|
|
-// NSColor *noteColor = [note color] ? : nil;
|
|
|
-// NSString *noteType = [note type] ? : @"";
|
|
|
-// NSString *noteString = [note objectValue] ? : @"";
|
|
|
+ let noteColor = note.color
|
|
|
+ var noteType = note.type ?? ""
|
|
|
+ var noteString = note.string() ?? ""
|
|
|
// NSString *pageString = [[note page] displayLabel] ? : @"";
|
|
|
-// NSDate *date = [note modificationDate] ? : nil;
|
|
|
-// NSString *authorString = [note userName] ? : @"";
|
|
|
+ var pageString = note.page.label ?? ""
|
|
|
+ let date = note.modificationDate()
|
|
|
+ var authorString = note.userName() ?? ""
|
|
|
// NSString *noteTextString = [note noteText].string ? : @"";
|
|
|
+ var noteTextString = note.string() ?? ""
|
|
|
//
|
|
|
// if([noteType isEqualToString:@"Redact"]) {
|
|
|
|
|
@@ -2907,165 +2910,175 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
//
|
|
|
let timeKey = self.noteTypeDict["kKMNoteFilterAnnotationTimeKey"] as? Bool
|
|
|
if timeKey == nil || timeKey == false {
|
|
|
-// if (date) {
|
|
|
-// cell.timeLabel.stringValue = [NSDate timeStringWithTimeDate:date];
|
|
|
-// } else {
|
|
|
- cell.timeLabel.stringValue = ""
|
|
|
-// }
|
|
|
+ if (date != nil) {
|
|
|
+ cell.timeLabel.stringValue = CPDFAnnotationModel.timeString(withTime: date)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ cell.timeLabel.stringValue = "kkkkkkkkk"
|
|
|
+ }
|
|
|
cell.timeLabel.isHidden = false
|
|
|
} else {
|
|
|
cell.timeLabel.isHidden = true
|
|
|
}
|
|
|
-// if (![[self.noteTypeDict objectForKey:@"kKMNoteFilterAnnotationPageKey"] boolValue]) {
|
|
|
-// CGRect labelsize =[cell.pageLabel.stringValue boundingRectWithSize:CGSizeMake(MAXFLOAT,CGRectGetHeight(cell.pageLabel.bounds)) options:NSStringDrawingUsesLineFragmentOrigin| NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[NSFont systemFontOfSize:12.0]}context:nil];
|
|
|
-// cell.pageLabelWidthConstraint.constant = labelsize.size.width + 5;
|
|
|
-// cell.pageLabel.stringValue = pageString;
|
|
|
-// cell.pageLabel.hidden = NO;
|
|
|
-// } else {
|
|
|
-// cell.pageLabel.hidden = YES;
|
|
|
-// }
|
|
|
-// if (![[self.noteTypeDict objectForKey:@"kKMNoteFilterAnnotationAutherKey"] boolValue]) {
|
|
|
-// cell.autherLabel.stringValue = authorString;
|
|
|
-// cell.autherLabel.hidden = NO;
|
|
|
-// } else {
|
|
|
-// cell.autherLabel.hidden = YES;
|
|
|
-// }
|
|
|
-// KMNoteTypeImageView *imageView = [[[KMNoteTypeImageView alloc] init] autorelease];
|
|
|
-// if ([note isKindOfClass:[KMAnnotationStamp class]]) {
|
|
|
-// KMAnnotationStamp *annotation_stamp = (KMAnnotationStamp *)note;
|
|
|
-// if (annotation_stamp.image) {
|
|
|
-// noteType = @"Stamp_Image";
|
|
|
-// }
|
|
|
-// } else if ([note isKindOfClass:[PDFAnnotationLine class]]) {
|
|
|
-// PDFAnnotationLine *annotation_line = (PDFAnnotationLine *)note;
|
|
|
-// if (annotation_line.startLineStyle == kPDFLineStyleNone &&
|
|
|
-// annotation_line.endLineStyle == kPDFLineStyleNone) {
|
|
|
-// noteType = @"Line_None";
|
|
|
-// } else if (annotation_line.startLineStyle == kPDFLineStyleNone &&
|
|
|
-// annotation_line.endLineStyle == kPDFLineStyleOpenArrow) {
|
|
|
-// noteType = @"Line_OpenArrow";
|
|
|
-// } else {
|
|
|
-// noteType = @"Line_None";
|
|
|
-// }
|
|
|
-// } else if ([note isKindOfClass:[PDFAnnotationButtonWidget class]]) {
|
|
|
-// PDFAnnotationButtonWidget *buttonWidget = (PDFAnnotationButtonWidget *)note;
|
|
|
-// if (buttonWidget.controlType == kPDFWidgetRadioButtonControl) {
|
|
|
-// noteType = SKAnnotationFormRadioButtonKey;
|
|
|
-// } else if (buttonWidget.controlType == kPDFWidgetCheckBoxControl){
|
|
|
-// noteType = SKAnnotationFormCheckBoxKey;
|
|
|
-// } else if (buttonWidget.controlType == kPDFWidgetPushButtonControl){
|
|
|
-// noteType = SKAnnotationFormActionButtonKey;
|
|
|
-// }
|
|
|
-// } else if ([note isKindOfClass:[PDFAnnotationTextWidget class]]) {
|
|
|
-// noteType = SKAnnotationFormTextFieldKey;
|
|
|
-// } else if ([note isKindOfClass:[PDFAnnotationChoiceWidget class]]) {
|
|
|
-// PDFAnnotationChoiceWidget *choiceWidget = (PDFAnnotationChoiceWidget *)note;
|
|
|
-// if (choiceWidget.isListChoice) {
|
|
|
-// noteType = SKAnnotationFormListMenuKey;
|
|
|
-// } else {
|
|
|
-// noteType = SKAnnotationFormComboBoxKey;
|
|
|
-// }
|
|
|
-// } else if ([note isKindOfClass:[KMTableAnnotation class]]) {
|
|
|
-// KMTableAnnotation *table = (KMTableAnnotation *)note;
|
|
|
-// noteType = @"Ink_Table";
|
|
|
-// } else if ([note isKindOfClass:[KMSelfSignAnnotation class]]) {
|
|
|
-// KMSelfSignAnnotation *selfSignNote = (KMSelfSignAnnotation *)note;
|
|
|
-// if (selfSignNote.annotationType == KMSelfSignTypeFalse) {
|
|
|
-// noteType = @"KMSelfSignTypeFalseActionButtonKey";
|
|
|
-// } else if (selfSignNote.annotationType == KMSelfSignTypeTure) {
|
|
|
-// noteType = @"KMSelfSignTypeTureActionButtonKey";
|
|
|
-// } else if (selfSignNote.annotationType == KMSelfSignTypeCircle) {
|
|
|
-// noteType = @"KMSelfSignTypeCircleActionButtonKey";
|
|
|
-// } else if (selfSignNote.annotationType == KMSelfSignTypeLine) {
|
|
|
-// noteType = @"KMSelfSignTypeLineActionButtonKey";
|
|
|
-// } else if (selfSignNote.annotationType == KMSelfSignTypeDot) {
|
|
|
-// noteType = @"KMSelfSignTypeDotActionButtonKey";
|
|
|
-// } else if (selfSignNote.annotationType == KMSelfSignTypeText) {
|
|
|
-// noteType = @"KMSelfSignTypeTextActionButtonKey";
|
|
|
-// }
|
|
|
-// }
|
|
|
+
|
|
|
+ let pageKey = self.noteTypeDict["kKMNoteFilterAnnotationPageKey"] as? Bool
|
|
|
+ if pageKey == nil || pageKey == false {
|
|
|
+ let labelsize = cell.pageLabel.stringValue.boundingRect(with: CGSizeMake(CGFloat(MAXFLOAT),CGRectGetHeight(cell.pageLabel.bounds)), options: [.usesLineFragmentOrigin, .usesFontLeading], attributes: [.font : NSFont.systemFont(ofSize: 12)])
|
|
|
+ cell.pageLabelWidthConstraint.constant = labelsize.size.width + 5
|
|
|
+ cell.pageLabel.stringValue = pageString
|
|
|
+ cell.pageLabel.isHidden = false
|
|
|
+ } else {
|
|
|
+ cell.pageLabel.isHidden = true
|
|
|
+ }
|
|
|
+
|
|
|
+ let autherKey = self.noteTypeDict["kKMNoteFilterAnnotationAutherKey"] as? Bool
|
|
|
+ if pageKey == nil || pageKey == false {
|
|
|
+ cell.autherLabel.stringValue = authorString
|
|
|
+ cell.autherLabel.isHidden = false
|
|
|
+ } else {
|
|
|
+ cell.autherLabel.isHidden = true
|
|
|
+ }
|
|
|
+
|
|
|
+ let imageView = KMNoteTypeImageView()
|
|
|
+ if note.isKind(of: CPDFStampAnnotation.self) {
|
|
|
+ let annotation_stamp = note as! CPDFStampAnnotation
|
|
|
+ if (annotation_stamp.stampImage() != nil) {
|
|
|
+ noteType = SKNStampString
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFLineAnnotation.self) {
|
|
|
+ let annotation_line = note as! CPDFLineAnnotation
|
|
|
+ if annotation_line.startLineStyle == .none && annotation_line.endLineStyle == .none {
|
|
|
+ noteType = SKNLine_NoneString
|
|
|
+ } else if annotation_line.startLineStyle == .none && annotation_line.endLineStyle == .openArrow {
|
|
|
+ noteType = SKNLine_OpenArrowString
|
|
|
+ } else {
|
|
|
+ noteType = SKNLine_NoneString
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFButtonWidgetAnnotation.self) {
|
|
|
+ let buttonWidget = note as! CPDFButtonWidgetAnnotation
|
|
|
+ if buttonWidget.controlType() == .radioButtonControl {
|
|
|
+ noteType = KMAnnotationFormRadioButtonKey
|
|
|
+ } else if buttonWidget.controlType() == .checkBoxControl {
|
|
|
+ noteType = KMAnnotationFormCheckBoxKey
|
|
|
+ } else if buttonWidget.controlType() == .pushButtonControl {
|
|
|
+ noteType = KMAnnotationFormActionButtonKey
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFTextWidgetAnnotation.self) {
|
|
|
+ noteType = KMAnnotationFormTextFieldKey
|
|
|
+ } else if note.isKind(of: CPDFChoiceWidgetAnnotation.self) {
|
|
|
+ let choiceWidget = note as! CPDFChoiceWidgetAnnotation
|
|
|
+ if choiceWidget.isListChoice {
|
|
|
+ noteType = KMAnnotationFormListMenuKey
|
|
|
+ } else {
|
|
|
+ noteType = KMAnnotationFormComboBoxKey
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: KMTableAnnotation.self) {
|
|
|
+ noteType = "Ink_Table"
|
|
|
+ } else if note.isKind(of: KMSelfSignAnnotation.self) {
|
|
|
+ let selfSignNote = note as! KMSelfSignAnnotation
|
|
|
+ if selfSignNote.annotationType == .signFalse {
|
|
|
+ noteType = "KMSelfSignTypeFalseActionButtonKey"
|
|
|
+ } else if (selfSignNote.annotationType == .signature) {
|
|
|
+ noteType = "KMSelfSignTypeTureActionButtonKey"
|
|
|
+ } else if (selfSignNote.annotationType == .signCircle) {
|
|
|
+ noteType = "KMSelfSignTypeCircleActionButtonKey"
|
|
|
+ } else if (selfSignNote.annotationType == .signLine) {
|
|
|
+ noteType = "KMSelfSignTypeLineActionButtonKey"
|
|
|
+ } else if (selfSignNote.annotationType == .signDot) {
|
|
|
+ noteType = "KMSelfSignTypeDotActionButtonKey"
|
|
|
+ } else if (selfSignNote.annotationType == .signText) {
|
|
|
+ noteType = "KMSelfSignTypeTextActionButtonKey"
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFSquareAnnotation.self) {
|
|
|
+ noteType = SKNSquareString
|
|
|
+ } else if note.isKind(of: CPDFTextAnnotation.self) {
|
|
|
+ let newAnnotation = note as! CPDFTextAnnotation
|
|
|
+ if newAnnotation.iconType() == .note {
|
|
|
+
|
|
|
+ }
|
|
|
+ noteType = SKNNoteString
|
|
|
+ }
|
|
|
+
|
|
|
+ cell.typeImageView.image = imageView.noteTypeImage(withType: noteType, color: noteColor ?? .red)
|
|
|
// cell.typeImageView.image = [imageView noteTypeImageWithType:noteType Color:noteColor];
|
|
|
-// cell.typeImageView.hidden = NO;
|
|
|
-//
|
|
|
-// if (![note isKindOfClass:[PDFAnnotationMarkup class]]) {
|
|
|
-// cell.isFold = YES;
|
|
|
-// }
|
|
|
-//
|
|
|
-// cell.noteContentBox.hidden = YES;
|
|
|
-// cell.noteImageView.hidden = YES;
|
|
|
-// cell.foldButton.hidden = YES;
|
|
|
-// cell.annotationContentLabel.hidden = NO;
|
|
|
-//
|
|
|
-// cell.noteContentLabel.stringValue = noteString;
|
|
|
-//
|
|
|
-// cell.contentView.hidden = NO;
|
|
|
-// [cell contentViewHidden:NO];
|
|
|
-// if ([note isKindOfClass:[PDFAnnotationMarkup class]]) {
|
|
|
-// PDFAnnotationMarkup *markup = (PDFAnnotationMarkup *)note;
|
|
|
-// if(noteTextString.length > 0) {
|
|
|
-// cell.foldButton.hidden = NO;
|
|
|
-// }
|
|
|
-// NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc]initWithString:noteTextString];
|
|
|
-// if (markup.markupType == kPDFMarkupTypeHighlight) {
|
|
|
-// [attributeStr addAttribute:NSBackgroundColorAttributeName value:noteColor range:NSMakeRange(0, noteTextString.length)];
|
|
|
-// } else if (markup.markupType == kPDFMarkupTypeStrikeOut) {
|
|
|
-// [attributeStr addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(0, noteTextString.length)];
|
|
|
-// [attributeStr addAttribute:NSStrikethroughColorAttributeName value:noteColor range:NSMakeRange(0, noteTextString.length)];
|
|
|
-// } else if (markup.markupType == kPDFMarkupTypeUnderline) {
|
|
|
-// [attributeStr addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(0, noteTextString.length)];
|
|
|
-// [attributeStr addAttribute:NSUnderlineColorAttributeName value:noteColor range:NSMakeRange(0, noteTextString.length)];
|
|
|
-// }
|
|
|
-// cell.annotationContentLabel.attributedStringValue = attributeStr;
|
|
|
-//
|
|
|
-// if (self.foldType == KMFoldAllAnnotationType_Unfold) {
|
|
|
-// cell.isFold = NO;
|
|
|
-// } else if (self.foldType == KMFoldAllAnnotationType_Fold) {
|
|
|
-// cell.isFold = YES;
|
|
|
-// } else {
|
|
|
+ cell.typeImageView.isHidden = false
|
|
|
+
|
|
|
+ if note.isKind(of: CPDFMarkupAnnotation.self) {
|
|
|
+ cell.isFold = true
|
|
|
+ }
|
|
|
+
|
|
|
+ cell.noteContentBox.isHidden = true
|
|
|
+ cell.noteImageView.isHidden = true
|
|
|
+ cell.foldButton.isHidden = true
|
|
|
+ cell.annotationContentLabel.isHidden = false
|
|
|
+
|
|
|
+ cell.noteContentLabel.stringValue = noteString
|
|
|
+
|
|
|
+ cell.contentView.isHidden = false
|
|
|
+ cell.contentViewHidden(false)
|
|
|
+ if note.isKind(of: CPDFMarkupAnnotation.self) {
|
|
|
+ let markup = note as! CPDFMarkupAnnotation
|
|
|
+ if(noteTextString.isEmpty == false) {
|
|
|
+ cell.foldButton.isHidden = false
|
|
|
+ }
|
|
|
+ var attributeStr = NSMutableAttributedString(string: noteTextString)
|
|
|
+ if (markup.markupType() == .highlight) {
|
|
|
+ attributeStr.addAttribute(.backgroundColor, value: noteColor as Any, range: NSMakeRange(0, noteTextString.count))
|
|
|
+ } else if (markup.markupType() == .strikeOut) {
|
|
|
+ attributeStr.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.single, range: NSMakeRange(0, noteTextString.count))
|
|
|
+ attributeStr.addAttribute(.strikethroughColor, value: noteColor as Any, range: NSMakeRange(0, noteTextString.count))
|
|
|
+ } else if (markup.markupType() == .underline) {
|
|
|
+ attributeStr.addAttribute(.underlineStyle, value: NSUnderlineStyle.single, range: NSMakeRange(0, noteTextString.count))
|
|
|
+ attributeStr.addAttribute(.underlineColor, value: noteColor as Any, range: NSMakeRange(0, noteTextString.count))
|
|
|
+ }
|
|
|
+ cell.annotationContentLabel.attributedStringValue = attributeStr
|
|
|
+
|
|
|
+ if (self.foldType == .unfold) {
|
|
|
+ cell.isFold = false
|
|
|
+ } else if (self.foldType == .fold) {
|
|
|
+ cell.isFold = true
|
|
|
+ } else {
|
|
|
// if (rightSideController.allFoldNotes.count > 0 && [rightSideController.allFoldNotes containsObject:note]) {
|
|
|
// cell.isFold = NO;
|
|
|
// } else {
|
|
|
// cell.isFold = YES;
|
|
|
// }
|
|
|
-// }
|
|
|
-// if (noteString.length > 0 && noteTextString.length > 0)
|
|
|
-// [cell contentViewHidden:NO];
|
|
|
-// else
|
|
|
-// [cell contentViewHidden:YES];
|
|
|
-// }
|
|
|
-//
|
|
|
-// else if ([note isKindOfClass:[PDFAnnotationLine class]] ||
|
|
|
-// [noteType isEqualToString:SKNSquareString] ||
|
|
|
-// [noteType isEqualToString:SKNCircleString] ||
|
|
|
-// [noteType isEqualToString:SKNInkString]) {
|
|
|
-// cell.annotationContentLabel.stringValue = noteString ? : @"";
|
|
|
-// if (noteString.length > 0)
|
|
|
-// [cell contentViewHidden:NO];
|
|
|
-// else
|
|
|
-// [cell contentViewHidden:YES];
|
|
|
-// } else if([note isKindOfClass:[PDFAnnotationStamp class]]) {
|
|
|
-// if ([note isKindOfClass:[KMSelfSignAnnotation class]]) {
|
|
|
-// KMSelfSignAnnotation *newAnnotation = (KMSelfSignAnnotation *)note;
|
|
|
-// KMSelfSignType type = newAnnotation.annotationType;
|
|
|
-// NSString *returnString = @"";
|
|
|
-// if (type == KMSelfSignTypeFalse) {
|
|
|
-// returnString = NSLocalizedString(@"X", nil);
|
|
|
-// } else if (type == KMSelfSignTypeTure) {
|
|
|
-// returnString = NSLocalizedString(@"Check mark", nil);
|
|
|
-// } else if (type == KMSelfSignTypeCircle) {
|
|
|
-// returnString = NSLocalizedString(@"Circle", nil);
|
|
|
-// } else if (type == KMSelfSignTypeLine) {
|
|
|
-// returnString = NSLocalizedString(@"Line", nil);
|
|
|
-// } else if (type == KMSelfSignTypeDot) {
|
|
|
-// returnString = NSLocalizedString(@"Dot", nil);
|
|
|
-// } else if (type == KMSelfSignTypeText) {
|
|
|
-// returnString = NSLocalizedString(@"Text", nil);
|
|
|
-// }
|
|
|
-// cell.annotationContentLabel.stringValue = returnString;
|
|
|
-// } else {
|
|
|
-// cell.annotationContentLabel.hidden = YES;
|
|
|
-//
|
|
|
-// cell.noteImageView.hidden = NO;
|
|
|
+ }
|
|
|
+ if (noteString.isEmpty == false && noteTextString.isEmpty == false) {
|
|
|
+ cell.contentViewHidden(false)
|
|
|
+ } else {
|
|
|
+ cell.contentViewHidden(true)
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFLineAnnotation.self) || noteType == SKNSquareString || noteType == SKNCircleString || noteType == SKNInkString {
|
|
|
+ cell.annotationContentLabel.stringValue = noteString
|
|
|
+ if (noteString.isEmpty == false) {
|
|
|
+ cell.contentViewHidden(false)
|
|
|
+ } else {
|
|
|
+ cell.contentViewHidden(true)
|
|
|
+ }
|
|
|
+ } else if note.isKind(of: CPDFStampAnnotation.self) {
|
|
|
+ if note.isKind(of: KMSelfSignAnnotation.self) {
|
|
|
+ let newAnnotation = note as! KMSelfSignAnnotation
|
|
|
+ let type = newAnnotation.annotationType
|
|
|
+ var returnString = ""
|
|
|
+ if (type == .signFalse) {
|
|
|
+ returnString = KMLocalizedString("X", nil)
|
|
|
+ } else if (type == .signature) {
|
|
|
+ returnString = KMLocalizedString("Check mark", nil)
|
|
|
+ } else if (type == .signCircle) {
|
|
|
+ returnString = KMLocalizedString("Circle", nil)
|
|
|
+ } else if (type == .signLine) {
|
|
|
+ returnString = KMLocalizedString("Line", nil)
|
|
|
+ } else if (type == .signDot) {
|
|
|
+ returnString = KMLocalizedString("Dot", nil)
|
|
|
+ } else if (type == .signText) {
|
|
|
+ returnString = KMLocalizedString("Text", nil)
|
|
|
+ }
|
|
|
+ cell.annotationContentLabel.stringValue = returnString
|
|
|
+ } else {
|
|
|
+ cell.annotationContentLabel.isHidden = true
|
|
|
+
|
|
|
+ cell.noteImageView.isHidden = false
|
|
|
// PDFAnnotation *annotation = note;
|
|
|
// NSImage *stampImage = [self stampCreateImage:annotation];
|
|
|
// if (stampImage) {
|
|
@@ -3074,8 +3087,9 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
// cell.noteImageView.hidden = YES;
|
|
|
// [cell contentViewHidden:YES];
|
|
|
// }
|
|
|
-// }
|
|
|
-// } else if ([note isKindOfClass:[SKNPDFAnnotationNote class]]) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+// else if ([note isKindOfClass:[SKNPDFAnnotationNote class]]) {
|
|
|
// cell.foldButton.hidden = NO;
|
|
|
// if (!noteString || noteString.length < 1){
|
|
|
// cell.annotationContentLabel.stringValue = noteTextString;
|
|
@@ -3107,31 +3121,33 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
// cell.foldButton.hidden = YES;
|
|
|
// }
|
|
|
//
|
|
|
-// } else {
|
|
|
-// cell.annotationContentLabel.stringValue = noteString;
|
|
|
-// cell.imageViewHeightConstraint.constant = cell.contentView.frame.size.height;
|
|
|
-// if (noteString.length > 0)
|
|
|
-// [cell contentViewHidden:NO];
|
|
|
-// else
|
|
|
-// [cell contentViewHidden:YES];
|
|
|
// }
|
|
|
+ else {
|
|
|
+ cell.annotationContentLabel.stringValue = noteString
|
|
|
+ cell.imageViewHeightConstraint.constant = cell.contentView.frame.size.height
|
|
|
+ if (noteString.isEmpty == false) {
|
|
|
+ cell.contentViewHidden(false)
|
|
|
+ } else {
|
|
|
+ cell.contentViewHidden(true)
|
|
|
+ }
|
|
|
+ }
|
|
|
//
|
|
|
-// cell.autherLayoutConstraint.constant = cell.autherLabel.hidden ? -(cell.autherLabel.bounds.size.width) + 10.0f : 10.0f;
|
|
|
-// cell.typeImageViewLayoutConstraint.constant = cell.typeImageView.hidden ? -(cell.typeImageView.bounds.size.width) : 0.0f;
|
|
|
-// cell.contentBoxLayoutConstraint.constant = cell.noteContentBox.hidden ? -(cell.noteContentBox.bounds.size.height+8.0) : 8.0f;
|
|
|
-// if ([note isKindOfClass:[PDFAnnotationStamp class]] && ![note isKindOfClass:[KMSelfSignAnnotation class]]) {
|
|
|
+ cell.autherLayoutConstraint.constant = cell.autherLabel.isHidden ? -(cell.autherLabel.bounds.size.width) + 10.0 : 10.0
|
|
|
+ cell.typeImageViewLayoutConstraint.constant = cell.typeImageView.isHidden ? -(cell.typeImageView.bounds.size.width) : 0.0
|
|
|
+ cell.contentBoxLayoutConstraint.constant = cell.noteContentBox.isHidden ? -(cell.noteContentBox.bounds.size.height+8.0) : 8.0
|
|
|
+ if note.isKind(of: CPDFStampAnnotation.self) && note.isKind(of: KMSelfSignAnnotation.self) == false {
|
|
|
//
|
|
|
-// } else {
|
|
|
-// if ([note isKindOfClass:[PDFAnnotationMarkup class]]) {
|
|
|
-// if (!cell.isFold) {
|
|
|
+ } else {
|
|
|
+ if note.isKind(of: CPDFMarkupAnnotation.self) {
|
|
|
+ if (!cell.isFold) {
|
|
|
// [rightSideController.allFoldNotes addObject:note];
|
|
|
-// } else {
|
|
|
-// cell.imageViewHeightConstraint.constant = 18.0 + 8;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// cell.imageViewHeightConstraint.constant = 18.0 + 8;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ } else {
|
|
|
+ cell.imageViewHeightConstraint.constant = 18.0 + 8
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ cell.imageViewHeightConstraint.constant = 18.0 + 8
|
|
|
+ }
|
|
|
+ }
|
|
|
// cell.isUnFoldNote = ^(PDFAnnotation *cellNote, BOOL isUnfold) {
|
|
|
// if (isUnfold) {
|
|
|
// if ([rightSideController.allFoldNotes containsObject:note]) {
|
|
@@ -3155,13 +3171,7 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
// }
|
|
|
// }
|
|
|
// };
|
|
|
-//
|
|
|
-// if (@available(macOS 10.13, *)) {
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// cell.foldButton.hidden = YES;
|
|
|
-// }
|
|
|
-// return cell
|
|
|
+ return cell
|
|
|
}
|
|
|
return nil
|
|
|
}
|