Show a contextual menu in the sidebar. Create and wire-up SidebarContextualMenuDelegate.
This commit is contained in:
parent
1f0123db36
commit
d59058c014
@ -51,6 +51,7 @@
|
|||||||
846E77421F6EF6A100A165E2 /* Database.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 846E77211F6EF5D100A165E2 /* Database.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
846E77421F6EF6A100A165E2 /* Database.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 846E77211F6EF5D100A165E2 /* Database.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
84702AA41FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84702AA31FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift */; };
|
84702AA41FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84702AA31FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift */; };
|
||||||
8472058120142E8900AD578B /* FeedInspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8472058020142E8900AD578B /* FeedInspectorViewController.swift */; };
|
8472058120142E8900AD578B /* FeedInspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8472058020142E8900AD578B /* FeedInspectorViewController.swift */; };
|
||||||
|
847FA121202BA34100BB56C8 /* SidebarContextualMenuDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847FA120202BA34100BB56C8 /* SidebarContextualMenuDelegate.swift */; };
|
||||||
848F6AE51FC29CFB002D422E /* FaviconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848F6AE41FC29CFA002D422E /* FaviconDownloader.swift */; };
|
848F6AE51FC29CFB002D422E /* FaviconDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848F6AE41FC29CFA002D422E /* FaviconDownloader.swift */; };
|
||||||
849A97431ED9EAA9007D329B /* AddFolderWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97421ED9EAA9007D329B /* AddFolderWindowController.swift */; };
|
849A97431ED9EAA9007D329B /* AddFolderWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97421ED9EAA9007D329B /* AddFolderWindowController.swift */; };
|
||||||
849A97531ED9EAC0007D329B /* AddFeedController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97511ED9EAC0007D329B /* AddFeedController.swift */; };
|
849A97531ED9EAC0007D329B /* AddFeedController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97511ED9EAC0007D329B /* AddFeedController.swift */; };
|
||||||
@ -542,6 +543,7 @@
|
|||||||
84702AA31FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkReadOrUnreadCommand.swift; sourceTree = "<group>"; };
|
84702AA31FA27AC0006B8943 /* MarkReadOrUnreadCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkReadOrUnreadCommand.swift; sourceTree = "<group>"; };
|
||||||
8472058020142E8900AD578B /* FeedInspectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedInspectorViewController.swift; sourceTree = "<group>"; };
|
8472058020142E8900AD578B /* FeedInspectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedInspectorViewController.swift; sourceTree = "<group>"; };
|
||||||
847752FE2008879500D93690 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
|
847752FE2008879500D93690 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
|
||||||
|
847FA120202BA34100BB56C8 /* SidebarContextualMenuDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarContextualMenuDelegate.swift; sourceTree = "<group>"; };
|
||||||
848F6AE41FC29CFA002D422E /* FaviconDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaviconDownloader.swift; sourceTree = "<group>"; };
|
848F6AE41FC29CFA002D422E /* FaviconDownloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaviconDownloader.swift; sourceTree = "<group>"; };
|
||||||
849A97421ED9EAA9007D329B /* AddFolderWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddFolderWindowController.swift; sourceTree = "<group>"; };
|
849A97421ED9EAA9007D329B /* AddFolderWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddFolderWindowController.swift; sourceTree = "<group>"; };
|
||||||
849A97511ED9EAC0007D329B /* AddFeedController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AddFeedController.swift; path = AddFeed/AddFeedController.swift; sourceTree = "<group>"; };
|
849A97511ED9EAC0007D329B /* AddFeedController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AddFeedController.swift; path = AddFeed/AddFeedController.swift; sourceTree = "<group>"; };
|
||||||
@ -920,6 +922,7 @@
|
|||||||
845F52EC1FB2B9FC00C10BF0 /* FeedPasteboardWriter.swift */,
|
845F52EC1FB2B9FC00C10BF0 /* FeedPasteboardWriter.swift */,
|
||||||
849A97821ED9EC63007D329B /* SidebarStatusBarView.swift */,
|
849A97821ED9EC63007D329B /* SidebarStatusBarView.swift */,
|
||||||
84D5BA1F201E8FB6009092BD /* SidebarGearMenuDelegate.swift */,
|
84D5BA1F201E8FB6009092BD /* SidebarGearMenuDelegate.swift */,
|
||||||
|
847FA120202BA34100BB56C8 /* SidebarContextualMenuDelegate.swift */,
|
||||||
844B5B6A1FEA224000C7C76A /* Keyboard */,
|
844B5B6A1FEA224000C7C76A /* Keyboard */,
|
||||||
845A29251FC928C7007B49E3 /* Cell */,
|
845A29251FC928C7007B49E3 /* Cell */,
|
||||||
84A37CB3201ECD610087C5AF /* Renaming */,
|
84A37CB3201ECD610087C5AF /* Renaming */,
|
||||||
@ -1826,6 +1829,7 @@
|
|||||||
84E46C7D1F75EF7B005ECFB3 /* AppDefaults.swift in Sources */,
|
84E46C7D1F75EF7B005ECFB3 /* AppDefaults.swift in Sources */,
|
||||||
D5907D972004B7EB005947E5 /* Account+Scriptability.swift in Sources */,
|
D5907D972004B7EB005947E5 /* Account+Scriptability.swift in Sources */,
|
||||||
841ABA4E20145E7300980E11 /* NothingInspectorViewController.swift in Sources */,
|
841ABA4E20145E7300980E11 /* NothingInspectorViewController.swift in Sources */,
|
||||||
|
847FA121202BA34100BB56C8 /* SidebarContextualMenuDelegate.swift in Sources */,
|
||||||
842E45CE1ED8C308000A8B52 /* AppNotifications.swift in Sources */,
|
842E45CE1ED8C308000A8B52 /* AppNotifications.swift in Sources */,
|
||||||
844B5B5B1FEA00FB00C7C76A /* TimelineKeyboardDelegate.swift in Sources */,
|
844B5B5B1FEA00FB00C7C76A /* TimelineKeyboardDelegate.swift in Sources */,
|
||||||
84DAEE321F870B390058304B /* DockBadge.swift in Sources */,
|
84DAEE321F870B390058304B /* DockBadge.swift in Sources */,
|
||||||
|
@ -359,6 +359,7 @@
|
|||||||
<outlet property="dataSource" destination="XML-A3-pDn" id="04v-0e-BM6"/>
|
<outlet property="dataSource" destination="XML-A3-pDn" id="04v-0e-BM6"/>
|
||||||
<outlet property="delegate" destination="XML-A3-pDn" id="fPE-cv-p5c"/>
|
<outlet property="delegate" destination="XML-A3-pDn" id="fPE-cv-p5c"/>
|
||||||
<outlet property="keyboardDelegate" destination="h5K-zR-cUa" id="BlT-aW-sea"/>
|
<outlet property="keyboardDelegate" destination="h5K-zR-cUa" id="BlT-aW-sea"/>
|
||||||
|
<outlet property="menu" destination="p3f-EZ-sSD" id="KTA-tl-UrO"/>
|
||||||
</connections>
|
</connections>
|
||||||
</outlineView>
|
</outlineView>
|
||||||
</subviews>
|
</subviews>
|
||||||
@ -441,11 +442,28 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
<connections>
|
<connections>
|
||||||
|
<outlet property="contextualMenuDelegate" destination="GIi-rR-u3i" id="HnU-AM-kBV"/>
|
||||||
<outlet property="gearMenuDelegate" destination="f3Y-bi-SLk" id="2on-6C-laM"/>
|
<outlet property="gearMenuDelegate" destination="f3Y-bi-SLk" id="2on-6C-laM"/>
|
||||||
<outlet property="outlineView" destination="cnV-kg-Dn2" id="FVf-OT-E3h"/>
|
<outlet property="outlineView" destination="cnV-kg-Dn2" id="FVf-OT-E3h"/>
|
||||||
</connections>
|
</connections>
|
||||||
</viewController>
|
</viewController>
|
||||||
<customObject id="Jih-JO-hIE" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
<customObject id="Jih-JO-hIE" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||||
|
<menu id="p3f-EZ-sSD">
|
||||||
|
<items>
|
||||||
|
<menuItem title="Item 1" id="ZDH-CV-Y2s">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Item 2" id="1F7-qu-7oN">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem title="Item 3" id="r9E-FO-GoU">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
<connections>
|
||||||
|
<outlet property="delegate" destination="GIi-rR-u3i" id="xCL-ce-fof"/>
|
||||||
|
</connections>
|
||||||
|
</menu>
|
||||||
<customObject id="f3Y-bi-SLk" customClass="SidebarGearMenuDelegate" customModule="Evergreen" customModuleProvider="target">
|
<customObject id="f3Y-bi-SLk" customClass="SidebarGearMenuDelegate" customModule="Evergreen" customModuleProvider="target">
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="sidebarViewController" destination="XML-A3-pDn" id="Tw0-4c-1Go"/>
|
<outlet property="sidebarViewController" destination="XML-A3-pDn" id="Tw0-4c-1Go"/>
|
||||||
@ -456,6 +474,11 @@
|
|||||||
<outlet property="sidebarViewController" destination="XML-A3-pDn" id="kwd-Zc-HJm"/>
|
<outlet property="sidebarViewController" destination="XML-A3-pDn" id="kwd-Zc-HJm"/>
|
||||||
</connections>
|
</connections>
|
||||||
</customObject>
|
</customObject>
|
||||||
|
<customObject id="GIi-rR-u3i" customClass="SidebarContextualMenuDelegate" customModule="Evergreen" customModuleProvider="target">
|
||||||
|
<connections>
|
||||||
|
<outlet property="sidebarViewController" destination="XML-A3-pDn" id="cFr-ow-5mf"/>
|
||||||
|
</connections>
|
||||||
|
</customObject>
|
||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="-74" y="-186"/>
|
<point key="canvasLocation" x="-74" y="-186"/>
|
||||||
</scene>
|
</scene>
|
||||||
@ -682,12 +705,12 @@
|
|||||||
<image name="NSMobileMe" width="32" height="32"/>
|
<image name="NSMobileMe" width="32" height="32"/>
|
||||||
<image name="NSRefreshTemplate" width="11" height="15"/>
|
<image name="NSRefreshTemplate" width="11" height="15"/>
|
||||||
<image name="NSShareTemplate" width="11" height="16"/>
|
<image name="NSShareTemplate" width="11" height="16"/>
|
||||||
<image name="action" width="9.5" height="9.5"/>
|
<image name="action" width="19" height="19"/>
|
||||||
<image name="markAllRead" width="11" height="9.5"/>
|
<image name="markAllRead" width="22" height="19"/>
|
||||||
<image name="markRead" width="9.5" height="9.5"/>
|
<image name="markRead" width="19" height="19"/>
|
||||||
<image name="newFolder" width="9.5" height="9.5"/>
|
<image name="newFolder" width="19" height="19"/>
|
||||||
<image name="nextUnread" width="12" height="9.5"/>
|
<image name="nextUnread" width="24" height="19"/>
|
||||||
<image name="openInBrowser" width="9.5" height="9.5"/>
|
<image name="openInBrowser" width="19" height="19"/>
|
||||||
<image name="star" width="9.5" height="9.5"/>
|
<image name="star" width="19" height="19"/>
|
||||||
</resources>
|
</resources>
|
||||||
</document>
|
</document>
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
//
|
||||||
|
// SidebarContextualMenuDelegate.swift
|
||||||
|
// Evergreen
|
||||||
|
//
|
||||||
|
// Created by Brent Simmons on 2/7/18.
|
||||||
|
// Copyright © 2018 Ranchero Software. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import AppKit
|
||||||
|
|
||||||
|
@objc final class SidebarContextualMenuDelegate: NSObject, NSMenuDelegate {
|
||||||
|
|
||||||
|
@IBOutlet weak var sidebarViewController: SidebarViewController?
|
||||||
|
|
||||||
|
public func menuNeedsUpdate(_ menu: NSMenu) {
|
||||||
|
|
||||||
|
guard let sidebarViewController = sidebarViewController else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.removeAllItems()
|
||||||
|
|
||||||
|
guard let contextualMenu = sidebarViewController.contextualMenuForSelectedObjects() else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let items = contextualMenu.items
|
||||||
|
contextualMenu.removeAllItems()
|
||||||
|
for menuItem in items {
|
||||||
|
menu.addItem(menuItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,7 @@ import RSCore
|
|||||||
|
|
||||||
@IBOutlet var outlineView: SidebarOutlineView!
|
@IBOutlet var outlineView: SidebarOutlineView!
|
||||||
@IBOutlet var gearMenuDelegate: SidebarGearMenuDelegate!
|
@IBOutlet var gearMenuDelegate: SidebarGearMenuDelegate!
|
||||||
|
@IBOutlet var contextualMenuDelegate: SidebarContextualMenuDelegate!
|
||||||
|
|
||||||
let treeControllerDelegate = SidebarTreeControllerDelegate()
|
let treeControllerDelegate = SidebarTreeControllerDelegate()
|
||||||
lazy var treeController: TreeController = {
|
lazy var treeController: TreeController = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user