Fixed: CPSearchField alignment from nib2cib

CPSearchField were not properly aligned in Aristo2 theme.
This fix uses the nib2cib-adjustment-frame information to align it.
It also improve the Nib2CibAlignement test.
This commit is contained in:
Christophe Serafin
2015-03-18 08:26:26 -07:00
parent 7c095175ab
commit 559ca3e97b
3 changed files with 51 additions and 4 deletions
+7 -1
View File
@@ -772,9 +772,15 @@ var themedButtonValues = nil,
[@"min-size", CGSizeMake(0.0, 29.0), [CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"max-size", CGSizeMake(-1.0, 29.0), [CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"nib2cib-adjustment-frame", CGRectMake(-3.0, 8.0, 7.0, 10.0), [CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"min-size", CGSizeMake(0.0, 25.0), [CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"max-size", CGSizeMake(-1.0, 25.0), [CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"nib2cib-adjustment-frame", CGRectMake(-4.0, 7.0, 8.0, 10.0), [CPThemeStateControlSizeSmall, CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"min-size", CGSizeMake(0.0, 20.0), [CPThemeStateControlSizeMini, CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"max-size", CGSizeMake(-1.0, 20.0), [CPThemeStateControlSizeMini, CPTextFieldStateRounded, CPThemeStateBezeled]]
[@"max-size", CGSizeMake(-1.0, 20.0), [CPThemeStateControlSizeMini, CPTextFieldStateRounded, CPThemeStateBezeled]],
[@"nib2cib-adjustment-frame", CGRectMake(-4.0, 7.0, 8.0, 10.0), [CPThemeStateControlSizeMini, CPTextFieldStateRounded, CPThemeStateBezeled]]
];
[self registerThemeValues:themedRoundedTextFieldValues forView:textfield];
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -253,12 +253,26 @@
<font key="titleFont" metaFont="system"/>
</box>
<box horizontalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="NGJ-xo-Sgv">
<rect key="frame" x="625" y="0.0" width="5" height="1049"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<box horizontalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="fMI-sC-ikZ">
<rect key="frame" x="625" y="0.0" width="5" height="1049"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<box horizontalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="O89-di-Xkv">
<rect key="frame" x="485" y="0.0" width="5" height="1049"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<box horizontalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="B7O-IK-5n5">
<rect key="frame" x="724" y="0.0" width="5" height="1049"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
@@ -1263,6 +1277,33 @@
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<searchField wantsLayer="YES" verticalHuggingPriority="750" id="Wtu-nF-85Q">
<rect key="frame" x="487" y="813" width="141" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<searchFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" id="Ef3-jh-MwM">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
</searchField>
<searchField wantsLayer="YES" verticalHuggingPriority="750" id="7Ox-VX-zHy">
<rect key="frame" x="487" y="777" width="141" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<searchFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" id="8Zc-eH-VwA">
<font key="font" metaFont="miniSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
</searchField>
<searchField wantsLayer="YES" verticalHuggingPriority="750" id="Gak-f5-3DT">
<rect key="frame" x="487" y="848" width="141" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" id="YUr-Ee-GKn">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
</searchField>
</subviews>
</view>
<point key="canvasLocation" x="339.5" y="437.5"/>