diff --git a/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/Contents.json b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/Contents.json new file mode 100644 index 0000000..a465dab --- /dev/null +++ b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icons8-search-2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icons8-search-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icons8-search.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-1.png b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-1.png new file mode 100644 index 0000000..6d36a48 Binary files /dev/null and b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-1.png differ diff --git a/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-2.png b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-2.png new file mode 100644 index 0000000..7550bd9 Binary files /dev/null and b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search-2.png differ diff --git a/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search.png b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search.png new file mode 100644 index 0000000..5ae587c Binary files /dev/null and b/Sessions Extension/Images/Media.xcassets/icons8-search.imageset/icons8-search.png differ diff --git a/Sessions Extension/SafariExtensionViewController/Base.lproj/SafariExtensionViewController.xib b/Sessions Extension/SafariExtensionViewController/Base.lproj/SafariExtensionViewController.xib index 64d8e89..0ad05c4 100644 --- a/Sessions Extension/SafariExtensionViewController/Base.lproj/SafariExtensionViewController.xib +++ b/Sessions Extension/SafariExtensionViewController/Base.lproj/SafariExtensionViewController.xib @@ -181,6 +181,10 @@ + + + + @@ -234,6 +238,7 @@ + diff --git a/Sessions Extension/SafariExtensionViewController/SafariExtensionViewControllerTable.swift b/Sessions Extension/SafariExtensionViewController/SafariExtensionViewControllerTable.swift index c8ed92c..b65c0ac 100644 --- a/Sessions Extension/SafariExtensionViewController/SafariExtensionViewControllerTable.swift +++ b/Sessions Extension/SafariExtensionViewController/SafariExtensionViewControllerTable.swift @@ -17,6 +17,7 @@ extension SafariExtensionViewController: NSTableViewDelegate, NSTableViewDataSou tableView.menu?.autoenablesItems = true tableView.registerForDraggedTypes([dragDropType]) tableView.singleMenu = singleSelectionMenu + tableView.vc = self } diff --git a/Sessions Extension/SafariExtensionViewController/TableView.swift b/Sessions Extension/SafariExtensionViewController/TableView.swift index 526b9f5..530ad5a 100644 --- a/Sessions Extension/SafariExtensionViewController/TableView.swift +++ b/Sessions Extension/SafariExtensionViewController/TableView.swift @@ -10,11 +10,20 @@ import Cocoa class TableView: NSTableView { weak var singleMenu: NSMenu! - + weak var vc: SafariExtensionViewController? override func rightMouseDown(with event: NSEvent) { super.rightMouseDown(with: event) let correctLocation = convert(event.locationInWindow, from: nil) - singleMenu.popUp(positioning: singleMenu.items.first, at: correctLocation, in: self) - + if let singleMenuWTabs = singleMenu { + let sessions = vc?.sessions + let pages = sessions?[self.clickedRow].pages ?? [] + singleMenuWTabs.item(withTag: 1)?.submenu?.removeAllItems() + for page in pages { + let menuItem = NSMenuItem(title: page.title, action: nil, keyEquivalent: "") + singleMenuWTabs.item(withTag: 1)?.submenu?.addItem(menuItem) + } + singleMenuWTabs.item(withTag: 1)?.title = "\(pages.count) tabs:" + singleMenuWTabs.popUp(positioning: singleMenuWTabs.items.first, at: correctLocation, in: self) + } } } diff --git a/Sessions.xcodeproj/xcuserdata/alex.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Sessions.xcodeproj/xcuserdata/alex.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 63deddc..91e3f07 100644 --- a/Sessions.xcodeproj/xcuserdata/alex.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Sessions.xcodeproj/xcuserdata/alex.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -452,5 +452,53 @@ landmarkType = "0"> + + + + + + + + + + + +