Using differen button style

This commit is contained in:
michael starke
2015-12-18 16:32:48 +01:00
parent fdd610266c
commit fc741151ed
5 changed files with 91 additions and 115 deletions

View File

@@ -68,13 +68,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="124"> <button focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="124">
<rect key="frame" x="241" y="466" width="32" height="19"/> <rect key="frame" x="241" y="464" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="32" id="176"/> <constraint firstAttribute="width" constant="32" id="176"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAddTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="177"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="177">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="addAttachment:" target="-2" id="271"/> <action selector="addAttachment:" target="-2" id="271"/>
@@ -171,16 +171,16 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="42g-QS-XtW"> <popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="42g-QS-XtW">
<rect key="frame" x="207" y="8" width="38" height="19"/> <rect key="frame" x="207" y="5" width="38" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="38" id="2EY-Pv-ic4"/> <constraint firstAttribute="width" constant="38" id="2EY-Pv-ic4"/>
</constraints> </constraints>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" pullsDown="YES" altersStateOfSelectedItem="NO" id="nJc-UT-cas"> <popUpButtonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" pullsDown="YES" altersStateOfSelectedItem="NO" id="nJc-UT-cas">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
<menu key="menu" title="OtherViews" id="sNS-o1-pD7"> <menu key="menu" title="OtherViews" id="sNS-o1-pD7">
<items> <items>
<menuItem hidden="YES" id="lbx-U1-RCe"> <menuItem image="NSActionTemplate" hidden="YES" id="lbx-U1-RCe">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
</menuItem> </menuItem>
<menuItem title="Save" id="0ok-MC-QMP"/> <menuItem title="Save" id="0ok-MC-QMP"/>
@@ -251,13 +251,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="179"> <button focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="179">
<rect key="frame" x="241" y="466" width="32" height="19"/> <rect key="frame" x="241" y="464" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="32" id="231"/> <constraint firstAttribute="width" constant="32" id="231"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="232"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="232">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="addCustomField:" target="-2" id="273"/> <action selector="addCustomField:" target="-2" id="273"/>
@@ -272,13 +272,13 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<scrollView borderType="line" autohidesScrollers="YES" horizontalLineScroll="56" horizontalPageScroll="10" verticalLineScroll="56" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="180" customClass="HNHUIScrollView"> <scrollView borderType="line" autohidesScrollers="YES" horizontalLineScroll="56" horizontalPageScroll="10" verticalLineScroll="56" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="180" customClass="HNHUIScrollView">
<rect key="frame" x="16" y="26" width="261" height="433"/> <rect key="frame" x="16" y="26" width="261" height="432"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="k8G-zp-BXZ"> <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="k8G-zp-BXZ">
<rect key="frame" x="1" y="1" width="259" height="431"/> <rect key="frame" x="1" y="1" width="259" height="430"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="none" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="54" rowSizeStyle="automatic" viewBased="YES" id="193"> <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="none" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="54" rowSizeStyle="automatic" viewBased="YES" id="193">
<rect key="frame" x="0.0" y="0.0" width="259" height="0.0"/> <rect key="frame" x="0.0" y="0.0" width="259" height="430"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/> <size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -325,13 +325,13 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="198"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="198">
<rect key="frame" x="223" y="11" width="32" height="19"/> <rect key="frame" x="223" y="8" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="32" id="215"/> <constraint firstAttribute="width" constant="32" id="215"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="216"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSRemoveTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="216">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
</button> </button>
</subviews> </subviews>
@@ -448,13 +448,13 @@
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="82" secondAttribute="trailing" constant="20" symbolic="YES" id="4df-0Y-ggz"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="82" secondAttribute="trailing" constant="20" symbolic="YES" id="4df-0Y-ggz"/>
<constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/> <constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/>
</constraints> </constraints>
<point key="canvasLocation" x="662.5" y="-37.5"/> <point key="canvasLocation" x="232.5" y="281.5"/>
</view> </view>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="252" height="453"/> <rect key="frame" x="0.0" y="0.0" width="252" height="457"/>
<subviews> <subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="52"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="52">
<rect key="frame" x="18" y="434" width="28" height="14"/> <rect key="frame" x="18" y="438" width="28" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Title" id="71"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Title" id="71">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -462,7 +462,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="53" customClass="HNHUIRoundedTextField"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="53" customClass="HNHUIRoundedTextField">
<rect key="frame" x="20" y="404" width="212" height="22"/> <rect key="frame" x="20" y="408" width="212" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="22" id="7Xj-3i-fBY"/> <constraint firstAttribute="height" constant="22" id="7Xj-3i-fBY"/>
</constraints> </constraints>
@@ -476,7 +476,7 @@
</connections> </connections>
</textField> </textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="54"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="54">
<rect key="frame" x="18" y="378" width="58" height="14"/> <rect key="frame" x="18" y="382" width="58" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Username" id="69"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Username" id="69">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -484,7 +484,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="55" customClass="HNHUIRoundedTextField"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="55" customClass="HNHUIRoundedTextField">
<rect key="frame" x="20" y="348" width="212" height="22"/> <rect key="frame" x="20" y="352" width="212" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="22" id="0l5-fD-0eW"/> <constraint firstAttribute="height" constant="22" id="0l5-fD-0eW"/>
</constraints> </constraints>
@@ -520,7 +520,7 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="58"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="58">
<rect key="frame" x="18" y="322" width="55" height="14"/> <rect key="frame" x="18" y="326" width="55" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Password" id="65"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Password" id="65">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -528,10 +528,10 @@
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="59"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="59">
<rect key="frame" x="20" y="265" width="212" height="19"/> <rect key="frame" x="20" y="264" width="212" height="25"/>
<buttonCell key="cell" type="roundRect" title="Generate" bezelStyle="roundedRect" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="64"> <buttonCell key="cell" type="roundTextured" title="Generate" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="64">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="_popUpPasswordGenerator:" target="-2" id="272"/> <action selector="_popUpPasswordGenerator:" target="-2" id="272"/>
@@ -539,7 +539,7 @@
</connections> </connections>
</button> </button>
<secureTextField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="60" customClass="HNHUIRoundedSecureTextField"> <secureTextField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="60" customClass="HNHUIRoundedSecureTextField">
<rect key="frame" x="20" y="292" width="173" height="22"/> <rect key="frame" x="20" y="296" width="172" height="22"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="22" id="VFI-jo-tOU"/> <constraint firstAttribute="height" constant="22" id="VFI-jo-tOU"/>
</constraints> </constraints>
@@ -556,9 +556,9 @@
</connections> </connections>
</secureTextField> </secureTextField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="61"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="61">
<rect key="frame" x="201" y="290" width="31" height="25"/> <rect key="frame" x="200" y="294" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="31" id="rSr-fw-11t"/> <constraint firstAttribute="width" constant="32" id="rSr-fw-11t"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSQuickLookTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="62"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSQuickLookTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="62">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/> <behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
@@ -582,13 +582,13 @@
</connections> </connections>
</button> </button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8">
<rect key="frame" x="201" y="185" width="31" height="19"/> <rect key="frame" x="200" y="182" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="31" id="Ped-nx-uti"/> <constraint firstAttribute="width" constant="32" id="Ped-nx-uti"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSActionTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="77"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSActionTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="77">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="pickExpiryDate:" target="-1" id="DQK-sp-SIL"/> <action selector="pickExpiryDate:" target="-1" id="DQK-sp-SIL"/>
@@ -681,7 +681,7 @@
<constraint firstItem="0U8-TS-giU" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" id="kLH-Bj-C5m"/> <constraint firstItem="0U8-TS-giU" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" id="kLH-Bj-C5m"/>
<constraint firstItem="57" firstAttribute="top" secondItem="59" secondAttribute="bottom" constant="8" symbolic="YES" id="lYe-am-xJx"/> <constraint firstItem="57" firstAttribute="top" secondItem="59" secondAttribute="bottom" constant="8" symbolic="YES" id="lYe-am-xJx"/>
</constraints> </constraints>
<point key="canvasLocation" x="310" y="-50.5"/> <point key="canvasLocation" x="515" y="-255.5"/>
</customView> </customView>
<view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter"> <view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter">
<rect key="frame" x="0.0" y="0.0" width="301" height="424"/> <rect key="frame" x="0.0" y="0.0" width="301" height="424"/>
@@ -796,29 +796,29 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
</scroller> </scroller>
</scrollView> </scrollView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Iy9-9L-Aev"> <button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Iy9-9L-Aev">
<rect key="frame" x="249" y="111" width="32" height="19"/> <rect key="frame" x="249" y="106" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="18" id="VeX-Jj-eA9"/> <constraint firstAttribute="height" constant="18" id="VeX-Jj-eA9"/>
<constraint firstAttribute="width" constant="32" id="mjs-Yf-Cb2"/> <constraint firstAttribute="width" constant="32" id="mjs-Yf-Cb2"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5J6-uD-iK6"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5J6-uD-iK6">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="addWindowAssociation:" target="-2" id="U5q-Gf-tsI"/> <action selector="addWindowAssociation:" target="-2" id="U5q-Gf-tsI"/>
</connections> </connections>
</button> </button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AAj-Ak-z46"> <button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="AAj-Ak-z46">
<rect key="frame" x="209" y="111" width="32" height="19"/> <rect key="frame" x="209" y="106" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="32" id="vWY-ez-gy9"/> <constraint firstAttribute="width" constant="32" id="vWY-ez-gy9"/>
<constraint firstAttribute="height" constant="18" id="xwN-WB-cn2"/> <constraint firstAttribute="height" constant="18" id="xwN-WB-cn2"/>
</constraints> </constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="86n-d4-lOW"> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSRemoveTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="86n-d4-lOW">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="removeWindowAssociation:" target="-2" id="hAz-SO-hJ0"/> <action selector="removeWindowAssociation:" target="-2" id="hAz-SO-hJ0"/>
@@ -868,16 +868,6 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HDS-Bz-jrr">
<rect key="frame" x="249" y="325" width="32" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="32" id="CbR-2P-dZH"/>
</constraints>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSActionTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="V5Z-qf-FVH">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="m1C-m8-BKR"> <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="m1C-m8-BKR">
<rect key="frame" x="249" y="8" width="32" height="25"/> <rect key="frame" x="249" y="8" width="32" height="25"/>
<constraints> <constraints>
@@ -888,6 +878,16 @@
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
</button> </button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HDS-Bz-jrr">
<rect key="frame" x="249" y="325" width="32" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="32" id="CbR-2P-dZH"/>
</constraints>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSActionTemplate" imagePosition="only" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="V5Z-qf-FVH">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="Iy9-9L-Aev" firstAttribute="top" secondItem="2YH-c2-Cwc" secondAttribute="bottom" constant="8" symbolic="YES" id="4OL-i2-4ng"/> <constraint firstItem="Iy9-9L-Aev" firstAttribute="top" secondItem="2YH-c2-Cwc" secondAttribute="bottom" constant="8" symbolic="YES" id="4OL-i2-4ng"/>
@@ -930,7 +930,7 @@
<constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/> <constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/>
<constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/> <constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/>
</constraints> </constraints>
<point key="canvasLocation" x="-28.5" y="-45"/> <point key="canvasLocation" x="190.5" y="-272"/>
</view> </view>
</objects> </objects>
<resources> <resources>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies> <dependencies>
<deployment identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9059"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
</dependencies> </dependencies>
<objects> <objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPGroupInspectorViewController"> <customObject id="-2" userLabel="File's Owner" customClass="MPGroupInspectorViewController">
@@ -30,7 +30,6 @@
<subviews> <subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="24"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="24">
<rect key="frame" x="18" y="242" width="35" height="14"/> <rect key="frame" x="18" y="242" width="35" height="14"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Name" id="25"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Name" id="25">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -39,7 +38,6 @@
</textField> </textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="23" customClass="HNHUIRoundedTextField"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="23" customClass="HNHUIRoundedTextField">
<rect key="frame" x="20" y="212" width="217" height="22"/> <rect key="frame" x="20" y="212" width="217" height="22"/>
<animations/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="26"> <textFieldCell key="cell" lineBreakMode="truncatingTail" truncatesLastVisibleLine="YES" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="26">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@@ -54,7 +52,6 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="14" id="pWR-o1-KI6"/> <constraint firstAttribute="height" constant="14" id="pWR-o1-KI6"/>
</constraints> </constraints>
<animations/>
<buttonCell key="cell" type="check" title="Expires" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingMiddle" state="on" inset="2" id="32"> <buttonCell key="cell" type="check" title="Expires" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingMiddle" state="on" inset="2" id="32">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
@@ -64,14 +61,13 @@
</connections> </connections>
</button> </button>
<button focusRingType="exterior" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4"> <button focusRingType="exterior" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4">
<rect key="frame" x="206" y="183" width="31" height="19"/> <rect key="frame" x="205" y="180" width="32" height="25"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="31" id="l5I-EF-dHs"/> <constraint firstAttribute="width" constant="32" id="l5I-EF-dHs"/>
</constraints> </constraints>
<animations/> <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSActionTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" focusRingType="exterior" imageScaling="proportionallyDown" inset="2" id="33">
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSActionTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" focusRingType="exterior" imageScaling="proportionallyDown" inset="2" id="33">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="pickExpiryDate:" target="-1" id="KIc-p2-zJQ"/> <action selector="pickExpiryDate:" target="-1" id="KIc-p2-zJQ"/>
@@ -80,7 +76,6 @@
</button> </button>
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="229"> <popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="229">
<rect key="frame" x="18" y="128" width="222" height="26"/> <rect key="frame" x="18" y="128" width="222" height="26"/>
<animations/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="230"> <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="230">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/> <font key="font" metaFont="menu"/>
@@ -92,7 +87,6 @@
</popUpButton> </popUpButton>
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="240"> <popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="240">
<rect key="frame" x="18" y="73" width="222" height="26"/> <rect key="frame" x="18" y="73" width="222" height="26"/>
<animations/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="242"> <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="242">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/> <font key="font" metaFont="menu"/>
@@ -102,18 +96,16 @@
<outlet property="nextKeyView" destination="Fnw-qz-IZU" id="Q0q-HY-T34"/> <outlet property="nextKeyView" destination="Fnw-qz-IZU" id="Q0q-HY-T34"/>
</connections> </connections>
</popUpButton> </popUpButton>
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="264"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="264">
<rect key="frame" x="18" y="160" width="40" height="14"/> <rect key="frame" x="18" y="160" width="41" height="14"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Search" id="265"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Search" id="265">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<textField verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="276"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="276">
<rect key="frame" x="18" y="105" width="53" height="14"/> <rect key="frame" x="18" y="105" width="52" height="14"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Autotype" id="277"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Autotype" id="277">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -122,7 +114,6 @@
</textField> </textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Fnw-qz-IZU" customClass="HNHUIRoundedTextField"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Fnw-qz-IZU" customClass="HNHUIRoundedTextField">
<rect key="frame" x="20" y="20" width="217" height="22"/> <rect key="frame" x="20" y="20" width="217" height="22"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="VeF-V7-i2I"> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="VeF-V7-i2I">
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@@ -134,7 +125,6 @@
</textField> </textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6Lw-XW-x20"> <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6Lw-XW-x20">
<rect key="frame" x="18" y="50" width="107" height="14"/> <rect key="frame" x="18" y="50" width="107" height="14"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Autotype Sequence" id="6FG-UZ-Adh"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Autotype Sequence" id="6FG-UZ-Adh">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
@@ -170,7 +160,6 @@
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Fnw-qz-IZU" secondAttribute="bottom" constant="20" symbolic="YES" id="xRe-8b-p6s"/> <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Fnw-qz-IZU" secondAttribute="bottom" constant="20" symbolic="YES" id="xRe-8b-p6s"/>
<constraint firstItem="264" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="12" id="xe7-ue-Wip"/> <constraint firstItem="264" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="12" id="xe7-ue-Wip"/>
</constraints> </constraints>
<animations/>
</view> </view>
</subviews> </subviews>
<constraints> <constraints>
@@ -179,18 +168,14 @@
<constraint firstAttribute="trailing" secondItem="38" secondAttribute="trailing" id="HP8-rS-ooi"/> <constraint firstAttribute="trailing" secondItem="38" secondAttribute="trailing" id="HP8-rS-ooi"/>
<constraint firstItem="38" firstAttribute="leading" secondItem="HjA-kA-fcX" secondAttribute="leading" id="h7m-U5-sA4"/> <constraint firstItem="38" firstAttribute="leading" secondItem="HjA-kA-fcX" secondAttribute="leading" id="h7m-U5-sA4"/>
</constraints> </constraints>
<animations/>
</clipView> </clipView>
<animations/>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="39"> <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="39">
<rect key="frame" x="-100" y="-100" width="257" height="16"/> <rect key="frame" x="-100" y="-100" width="257" height="16"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller> </scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="40"> <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="40">
<rect key="frame" x="-100" y="-100" width="15" height="201"/> <rect key="frame" x="-100" y="-100" width="15" height="201"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<animations/>
</scroller> </scroller>
</scrollView> </scrollView>
</objects> </objects>

View File

@@ -21,7 +21,6 @@
// //
#import "MPCustomFieldTableViewDelegate.h" #import "MPCustomFieldTableViewDelegate.h"
#import "MPDocument.h"
#import "MPCustomFieldTableCellView.h" #import "MPCustomFieldTableCellView.h"
#import "MPEntryInspectorViewController.h" #import "MPEntryInspectorViewController.h"
@@ -30,31 +29,21 @@
@implementation MPCustomFieldTableViewDelegate @implementation MPCustomFieldTableViewDelegate
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
MPDocument *document = [[[tableView window] windowController] document];
KPKEntry *entry = document.selectedEntry;
MPCustomFieldTableCellView *view = [tableView makeViewWithIdentifier:@"SelectedCell" owner:tableView]; MPCustomFieldTableCellView *view = [tableView makeViewWithIdentifier:@"SelectedCell" owner:tableView];
[[NSNotificationCenter defaultCenter] addObserver:self [view.labelTextField bind:NSValueBinding
selector:@selector(_customFieldFrameChanged:) toObject:view
name:NSViewFrameDidChangeNotification withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(key))]
object:view]; options:@{ NSValidatesImmediatelyBindingOption: @YES }];
[view.valueTextField bind:NSValueBinding
NSAssert([entry.customAttributes count] > row, @"Count of custom attributes must match row"); toObject:view
KPKAttribute *attribute = entry.customAttributes[row]; withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(value))]
NSDictionary *validateOptions = @{ NSValidatesImmediatelyBindingOption: @YES }; options:nil];
[view.labelTextField bind:NSValueBinding toObject:attribute withKeyPath:@"key" options:validateOptions]; view.removeButton.target = self.viewController;
[view.valueTextField bind:NSValueBinding toObject:attribute withKeyPath:@"value" options:nil]; view.removeButton.action = @selector(removeCustomField:);
[view.removeButton setTarget:self.viewController]; view.removeButton.tag = row;
[view.removeButton setAction:@selector(removeCustomField:)];
[view.removeButton setTag:row];
return view; return view;
} }
- (void)_customFieldFrameChanged:(NSNotification *)notification {
// NSView *sender = [notification object];
// NSLog(@"didChangeFrameFor: %@ to: %@", sender, NSStringFromRect([sender frame]));
}
@end @end

View File

@@ -13,9 +13,9 @@
- (void)drawRect:(NSRect)dirtyRect { - (void)drawRect:(NSRect)dirtyRect {
[[NSGraphicsContext currentContext] saveGraphicsState]; [[NSGraphicsContext currentContext] saveGraphicsState];
[[NSColor clearColor] set]; [[NSColor clearColor] set];
NSRectFill([self bounds]); NSRectFill(self.bounds);
NSColor *backgroundColor = [NSColor colorWithCalibratedWhite:0 alpha:0.7]; NSColor *backgroundColor = [NSColor colorWithCalibratedWhite:0 alpha:0.7];
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:10 yRadius:10]; NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:self.bounds xRadius:10 yRadius:10];
[backgroundColor set]; [backgroundColor set];
[path fill]; [path fill];
[[NSGraphicsContext currentContext] restoreGraphicsState]; [[NSGraphicsContext currentContext] restoreGraphicsState];

View File

@@ -6,11 +6,12 @@
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. // Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
// //
#define ELIPSIS_OFFSET 0 static CGFloat kMPElipsisOffset = 0.0;
#define ELIPSIS_HEIGHT 20 static CGFloat kMPElipsisHeight = 20.0;
#define SHADOW_OFFSET 10 static CGFloat kMPShadowOffset = 10.0;
#import "MPShadowBox.h" #import "MPShadowBox.h"
#import "MPFlagsHelper.h"
@implementation MPShadowBox @implementation MPShadowBox
@@ -28,7 +29,7 @@
- (void)drawRect:(NSRect)dirtyRect { - (void)drawRect:(NSRect)dirtyRect {
dirtyRect = [self bounds]; dirtyRect = self.bounds;
[[NSGraphicsContext currentContext] saveGraphicsState]; [[NSGraphicsContext currentContext] saveGraphicsState];
NSColor *topColor = [NSColor colorWithCalibratedWhite:0.9 alpha:1]; NSColor *topColor = [NSColor colorWithCalibratedWhite:0.9 alpha:1];
@@ -37,19 +38,20 @@
[gradient drawInRect:dirtyRect angle:-90]; [gradient drawInRect:dirtyRect angle:-90];
NSShadow *dropShadow = [[NSShadow alloc] init]; NSShadow *dropShadow = [[NSShadow alloc] init];
[dropShadow setShadowColor:[NSColor colorWithCalibratedWhite:0 alpha:0.5]]; dropShadow.shadowColor = [NSColor colorWithCalibratedWhite:0 alpha:0.5];
[dropShadow setShadowBlurRadius:10]; dropShadow.shadowBlurRadius = 10;
[dropShadow set]; [dropShadow set];
[[NSColor redColor] set]; // Use red to show visual errors [[NSColor redColor] set]; // Use red to show visual errors
if(0 != (self.shadowDisplay & MPShadowTop)) {
[dropShadow setShadowOffset:NSMakeSize(0, -SHADOW_OFFSET)]; if(MPIsFlagSetInOptions(MPShadowTop, self.shadowDisplay)) {
NSRect topElispis = NSMakeRect(0, dirtyRect.size.height + ELIPSIS_OFFSET, dirtyRect.size.width, ELIPSIS_HEIGHT); dropShadow.shadowOffset = NSMakeSize(0, -kMPShadowOffset);
NSRect topElispis = NSMakeRect(0, dirtyRect.size.height + kMPElipsisOffset, dirtyRect.size.width, kMPElipsisHeight);
[[NSBezierPath bezierPathWithOvalInRect:topElispis] fill]; [[NSBezierPath bezierPathWithOvalInRect:topElispis] fill];
} }
if(0 != (self.shadowDisplay & MPShadowBottom)) { if(MPIsFlagSetInOptions(MPShadowBottom, self.shadowDisplay)) {
NSRect bottomElipsis = NSMakeRect(0, - ( ELIPSIS_OFFSET + ELIPSIS_HEIGHT ), dirtyRect.size.width, ELIPSIS_HEIGHT); NSRect bottomElipsis = NSMakeRect(0, - ( kMPElipsisOffset + kMPElipsisHeight ), dirtyRect.size.width, kMPElipsisHeight);
[dropShadow setShadowOffset:NSMakeSize(0, SHADOW_OFFSET)]; dropShadow.shadowOffset = NSMakeSize(0, kMPShadowOffset);
[[NSBezierPath bezierPathWithOvalInRect:bottomElipsis] fill]; [[NSBezierPath bezierPathWithOvalInRect:bottomElipsis] fill];
} }
@@ -59,7 +61,7 @@
- (void)setShadowDisplay:(MPShadowDisplay)shadowDisplay { - (void)setShadowDisplay:(MPShadowDisplay)shadowDisplay {
if(_shadowDisplay != shadowDisplay) { if(_shadowDisplay != shadowDisplay) {
_shadowDisplay = shadowDisplay; _shadowDisplay = shadowDisplay;
[self setNeedsDisplay:YES]; self.needsDisplay = YES;
} }
} }