mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Implement share dialog UI
This commit is contained in:
parent
54275225a7
commit
ee033398c1
22
Mac/Resources/Assets.xcassets/shareExtension.imageset/Contents.json
vendored
Normal file
22
Mac/Resources/Assets.xcassets/shareExtension.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "shareExtensionx1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "shareExtensionx2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
Mac/Resources/Assets.xcassets/shareExtension.imageset/shareExtensionx1.png
vendored
Normal file
BIN
Mac/Resources/Assets.xcassets/shareExtension.imageset/shareExtensionx1.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
BIN
Mac/Resources/Assets.xcassets/shareExtension.imageset/shareExtensionx2.png
vendored
Normal file
BIN
Mac/Resources/Assets.xcassets/shareExtension.imageset/shareExtensionx2.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
@ -1,22 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13150" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17147" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13150"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17147"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ShareViewController" customModuleProvider="target">
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ShareViewController" customModule="NetNewsWire_Share_Extension" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="view" destination="1" id="2"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="388" height="202"/>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="272" height="165"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1uM-r7-H1c">
|
||||
<rect key="frame" x="302" y="3" width="82" height="32"/>
|
||||
<rect key="frame" x="181" y="3" width="88" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Send" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="2l4-PO-we5">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@ -28,7 +29,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NVE-vN-dkz">
|
||||
<rect key="frame" x="224" y="3" width="82" height="32"/>
|
||||
<rect key="frame" x="99" y="3" width="88" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="cP1-hK-9ZX"/>
|
||||
</constraints>
|
||||
@ -43,36 +44,103 @@ Gw
|
||||
<action selector="cancel:" target="-2" id="Qav-AK-DGt"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="aNc-0i-CWK">
|
||||
<rect key="frame" x="140" y="170" width="108" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="My Service Title" id="0xp-rC-2gr">
|
||||
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RbV-Vs-snd">
|
||||
<rect key="frame" x="73" y="122" width="126" height="24"/>
|
||||
<subviews>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cSz-Hi-lWr">
|
||||
<rect key="frame" x="0.0" y="0.0" width="24" height="24"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="JzZ-8C-8Dc"/>
|
||||
<constraint firstAttribute="width" constant="24" id="NpE-ET-scM"/>
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="shareExtension" id="swn-1V-VCb"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GhJ-6e-cD4">
|
||||
<rect key="frame" x="30" y="3" width="98" height="19"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="NetNewsWire" id="5Ed-E1-Gf1">
|
||||
<font key="font" textStyle="title3" name=".SFNS-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6li-eA-JHO">
|
||||
<rect key="frame" x="10" y="84" width="46" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Name:" id="Piv-xr-hYI">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4M6-D5-WIf">
|
||||
<rect key="frame" x="110" y="170" width="22" height="22"/>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KT5-nj-VPk">
|
||||
<rect key="frame" x="6" y="51" width="50" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Folder:" id="qp4-R2-aO5">
|
||||
<font key="font" metaFont="systemBold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AZO-uN-Q3y" userLabel="Folder Popup">
|
||||
<rect key="frame" x="60" y="47" width="205" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="BOe-aZ-Njc"/>
|
||||
<constraint firstAttribute="height" constant="22" id="zLg-1a-wlZ"/>
|
||||
<constraint firstAttribute="width" constant="200" id="5En-ig-EpD"/>
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="q3u-Am-ZIA"/>
|
||||
</imageView>
|
||||
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="wvm-BK-3HS" id="Qng-aG-J5K">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="JY9-2J-mJp">
|
||||
<items>
|
||||
<menuItem title="Item 1" state="on" id="wvm-BK-3HS"/>
|
||||
<menuItem title="Item 2" id="jf0-bY-EUJ"/>
|
||||
<menuItem title="Item 3" id="Djb-KO-yjg"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HzY-aJ-Kyc" userLabel="Name Text Field">
|
||||
<rect key="frame" x="62" y="81" width="200" height="21"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Optional" drawsBackground="YES" usesSingleLineMode="YES" id="27c-xz-zoJ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="1uM-r7-H1c" firstAttribute="leading" secondItem="NVE-vN-dkz" secondAttribute="trailing" constant="8" id="1UO-J1-LbJ"/>
|
||||
<constraint firstItem="NVE-vN-dkz" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="3N9-qo-UfS"/>
|
||||
<constraint firstItem="HzY-aJ-Kyc" firstAttribute="top" secondItem="RbV-Vs-snd" secondAttribute="bottom" constant="20" id="4D3-YV-msL"/>
|
||||
<constraint firstAttribute="bottom" secondItem="1uM-r7-H1c" secondAttribute="bottom" constant="10" id="4wH-De-nMF"/>
|
||||
<constraint firstAttribute="bottom" secondItem="NVE-vN-dkz" secondAttribute="bottom" constant="10" id="USG-Gg-of3"/>
|
||||
<constraint firstItem="1uM-r7-H1c" firstAttribute="top" secondItem="AZO-uN-Q3y" secondAttribute="bottom" constant="20" id="AEF-ge-ntA"/>
|
||||
<constraint firstItem="6li-eA-JHO" firstAttribute="baseline" secondItem="HzY-aJ-Kyc" secondAttribute="baseline" id="B7x-4H-WTn"/>
|
||||
<constraint firstItem="NVE-vN-dkz" firstAttribute="centerY" secondItem="1uM-r7-H1c" secondAttribute="centerY" id="HYN-DC-DWc"/>
|
||||
<constraint firstItem="AZO-uN-Q3y" firstAttribute="trailing" secondItem="HzY-aJ-Kyc" secondAttribute="trailing" id="Hwv-Q7-40h"/>
|
||||
<constraint firstItem="HzY-aJ-Kyc" firstAttribute="leading" secondItem="6li-eA-JHO" secondAttribute="trailing" constant="8" id="ItU-bg-BAi"/>
|
||||
<constraint firstItem="AZO-uN-Q3y" firstAttribute="top" secondItem="HzY-aJ-Kyc" secondAttribute="bottom" constant="10" id="LVY-CL-Uad"/>
|
||||
<constraint firstItem="1uM-r7-H1c" firstAttribute="trailing" secondItem="AZO-uN-Q3y" secondAttribute="trailing" id="Lxo-KH-Tt0"/>
|
||||
<constraint firstItem="AZO-uN-Q3y" firstAttribute="leading" secondItem="HzY-aJ-Kyc" secondAttribute="leading" id="YcI-jO-fZR"/>
|
||||
<constraint firstItem="1uM-r7-H1c" firstAttribute="leading" secondItem="NVE-vN-dkz" secondAttribute="trailing" constant="8" id="a8N-vS-Ew9"/>
|
||||
<constraint firstItem="aNc-0i-CWK" firstAttribute="centerY" secondItem="4M6-D5-WIf" secondAttribute="centerY" constant="2.5" id="ilP-G0-GVG"/>
|
||||
<constraint firstItem="RbV-Vs-snd" firstAttribute="centerX" secondItem="1" secondAttribute="centerX" id="a8c-Qc-hKw"/>
|
||||
<constraint firstItem="KT5-nj-VPk" firstAttribute="baseline" secondItem="AZO-uN-Q3y" secondAttribute="baseline" id="fDO-8h-qR5"/>
|
||||
<constraint firstItem="KT5-nj-VPk" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="8" id="hpi-b1-IGI"/>
|
||||
<constraint firstItem="RbV-Vs-snd" firstAttribute="top" secondItem="1" secondAttribute="top" constant="20" symbolic="YES" id="lDo-dF-3At"/>
|
||||
<constraint firstItem="NVE-vN-dkz" firstAttribute="width" secondItem="1uM-r7-H1c" secondAttribute="width" id="qPo-ky-Fcw"/>
|
||||
<constraint firstAttribute="trailing" secondItem="1uM-r7-H1c" secondAttribute="trailing" constant="10" id="qfT-cw-QQ2"/>
|
||||
<constraint firstAttribute="centerX" secondItem="aNc-0i-CWK" secondAttribute="centerX" id="uV3-Wn-RA3"/>
|
||||
<constraint firstItem="aNc-0i-CWK" firstAttribute="leading" secondItem="4M6-D5-WIf" secondAttribute="trailing" constant="10" id="vFR-5i-Dvo"/>
|
||||
<constraint firstItem="aNc-0i-CWK" firstAttribute="top" secondItem="1" secondAttribute="top" constant="15" id="vpR-tf-ebx"/>
|
||||
<constraint firstItem="AZO-uN-Q3y" firstAttribute="leading" secondItem="KT5-nj-VPk" secondAttribute="trailing" constant="8" id="yyu-gR-8rs"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-99" y="134.5"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="shareExtension" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Share Extension</string>
|
||||
<string>NetNewsWire</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
|
@ -54,7 +54,16 @@ class ShareViewController: NSViewController {
|
||||
}
|
||||
|
||||
@IBAction func send(_ sender: AnyObject?) {
|
||||
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
|
||||
guard let url = url, let selectedContainer = selectedContainer, let containerID = selectedContainer.containerID else {
|
||||
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
|
||||
return
|
||||
}
|
||||
|
||||
// let name = contentText.isEmpty ? nil : contentText
|
||||
// let request = ExtensionFeedAddRequest(name: name, feedURL: url, destinationContainerID: containerID)
|
||||
// ExtensionFeedAddRequestFile.save(request)
|
||||
|
||||
self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
|
||||
}
|
||||
|
||||
@IBAction func cancel(_ sender: AnyObject?) {
|
||||
|
@ -653,6 +653,7 @@
|
||||
51EF0F8E2279C9260050506E /* AccountsAdd.xib in Resources */ = {isa = PBXBuildFile; fileRef = 51EF0F8D2279C9260050506E /* AccountsAdd.xib */; };
|
||||
51EF0F902279C9500050506E /* AccountsAddViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51EF0F8F2279C9500050506E /* AccountsAddViewController.swift */; };
|
||||
51EF0F922279CA620050506E /* AccountsAddTableCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51EF0F912279CA620050506E /* AccountsAddTableCellView.swift */; };
|
||||
51EFDA1A24E6159C0085C3D6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 849C64671ED37A5D003D8FC0 /* Assets.xcassets */; };
|
||||
51F85BEB22724CB600C787DC /* About.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 51F85BEA22724CB600C787DC /* About.rtf */; };
|
||||
51F85BEF2272520B00C787DC /* Thanks.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 51F85BEE2272520B00C787DC /* Thanks.rtf */; };
|
||||
51F85BF12272524100C787DC /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 51F85BF02272524100C787DC /* Credits.rtf */; };
|
||||
@ -4075,6 +4076,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
510C416424E5CDE3008226FD /* ShareViewController.xib in Resources */,
|
||||
51EFDA1A24E6159C0085C3D6 /* Assets.xcassets in Resources */,
|
||||
510C415F24E5CDE3008226FD /* icon.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user