|
@@ -198,9 +198,9 @@ extension KMMainViewController {
|
|
let stypItem = NSMenuItem(title: NSLocalizedString("Annotation", comment: ""), action: nil, target: self)
|
|
let stypItem = NSMenuItem(title: NSLocalizedString("Annotation", comment: ""), action: nil, target: self)
|
|
let stypeMenu = NSMenu()
|
|
let stypeMenu = NSMenu()
|
|
if listView.currentSelection != nil && listView.currentSelection.selectionType() == .text {
|
|
if listView.currentSelection != nil && listView.currentSelection.selectionType() == .text {
|
|
- _ = stypeMenu.addItem(withTitle: NSLocalizedString("Highlight", comment: ""), action: #selector(addAnnotationForStyleMenu), target: self, tag: 0)
|
|
|
|
- _ = stypeMenu.addItem(withTitle: NSLocalizedString("Underline", comment: ""), action: #selector(addAnnotationForStyleMenu), target: self, tag: 1)
|
|
|
|
- _ = stypeMenu.addItem(withTitle: NSLocalizedString("Strikethrough", comment: ""), action: #selector(addAnnotationForStyleMenu), target: self, tag: 2)
|
|
|
|
|
|
+ _ = stypeMenu.addItem(withTitle: NSLocalizedString("Highlight", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 0)
|
|
|
|
+ _ = stypeMenu.addItem(withTitle: NSLocalizedString("Underline", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 1)
|
|
|
|
+ _ = stypeMenu.addItem(withTitle: NSLocalizedString("Strikethrough", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
|
|
stypeMenu.addItem(NSMenuItem.separator())
|
|
stypeMenu.addItem(NSMenuItem.separator())
|
|
}
|
|
}
|
|
// stypeMenu.addItem(withTitle: NSLocalizedString("Freehand", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 0)
|
|
// stypeMenu.addItem(withTitle: NSLocalizedString("Freehand", comment: ""), action: #selector(menuItemAnnotationClick_addStype), target: self, tag: 0)
|
|
@@ -462,10 +462,14 @@ extension KMMainViewController {
|
|
return highlightLinksItem
|
|
return highlightLinksItem
|
|
}
|
|
}
|
|
|
|
|
|
- func addAnnotationForStyleMenu(menu:NSMenu) {
|
|
|
|
- if menu == nil {
|
|
|
|
|
|
+ func addAnnotationForStyleMenu(_ item: NSMenuItem?) {
|
|
|
|
+ if item == nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let menu = NSMenu()
|
|
|
|
+ item?.submenu = menu
|
|
|
|
+
|
|
let height = NSMenuItem(title: NSLocalizedString("Highlight", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 0)
|
|
let height = NSMenuItem(title: NSLocalizedString("Highlight", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 0)
|
|
let underline = NSMenuItem(title: NSLocalizedString("Underline", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 1)
|
|
let underline = NSMenuItem(title: NSLocalizedString("Underline", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 1)
|
|
let strickout = NSMenuItem(title: NSLocalizedString("Strikethrough", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
|
|
let strickout = NSMenuItem(title: NSLocalizedString("Strikethrough", comment: ""), action: #selector(menuItemAnnotationClick_add), target: self, tag: 2)
|