Browse files

[core] moved NITextField to its own feature, added edge inset support

  • Loading branch information...
1 parent 1386315 commit 9f7c0e151c1cb5787bd2a8c779d553b98da241ac @djMax djMax committed Feb 26, 2013
View
20 examples/css/CSSDemo.xcodeproj/project.pbxproj
@@ -71,9 +71,9 @@
C7A8793616D7C8EC00A0C23F /* UITableView+NIStyleable.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8792E16D7C8EB00A0C23F /* UITableView+NIStyleable.m */; };
C7A8793716D7C8EC00A0C23F /* UITextField+NIStyleable.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8793016D7C8EC00A0C23F /* UITextField+NIStyleable.m */; };
C7A8793816D7C8EC00A0C23F /* UIToolbar+NIStyleable.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8793216D7C8EC00A0C23F /* UIToolbar+NIStyleable.m */; };
- C7A8793B16D7C99800A0C23F /* NITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8793A16D7C99800A0C23F /* NITextField.m */; };
C7B9283F16D2B45A001BF61C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C7B9283D16D2B45A001BF61C /* Localizable.strings */; };
C7B9284B16D2F736001BF61C /* NIInvocationMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = C7B9284A16D2F736001BF61C /* NIInvocationMethods.m */; };
+ C7BBC70816DDC2A600833DC9 /* NITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BBC70716DDC2A600833DC9 /* NITextField.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -199,11 +199,11 @@
C7A8793016D7C8EC00A0C23F /* UITextField+NIStyleable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UITextField+NIStyleable.m"; path = "../../src/css/src/UITextField+NIStyleable.m"; sourceTree = "<group>"; };
C7A8793116D7C8EC00A0C23F /* UIToolbar+NIStyleable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIToolbar+NIStyleable.h"; path = "../../src/css/src/UIToolbar+NIStyleable.h"; sourceTree = "<group>"; };
C7A8793216D7C8EC00A0C23F /* UIToolbar+NIStyleable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIToolbar+NIStyleable.m"; path = "../../src/css/src/UIToolbar+NIStyleable.m"; sourceTree = "<group>"; };
- C7A8793916D7C99800A0C23F /* NITextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NITextField.h; path = ../../src/core/src/NITextField.h; sourceTree = "<group>"; };
- C7A8793A16D7C99800A0C23F /* NITextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NITextField.m; path = ../../src/core/src/NITextField.m; sourceTree = "<group>"; };
C7B9283E16D2B45A001BF61C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = resources/en.lproj/Localizable.strings; sourceTree = "<group>"; };
C7B9284916D2F736001BF61C /* NIInvocationMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIInvocationMethods.h; path = ../../src/core/src/NIInvocationMethods.h; sourceTree = "<group>"; };
C7B9284A16D2F736001BF61C /* NIInvocationMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIInvocationMethods.m; path = ../../src/core/src/NIInvocationMethods.m; sourceTree = "<group>"; };
+ C7BBC70616DDC2A600833DC9 /* NITextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NITextField.h; path = ../../src/textfield/src/NITextField.h; sourceTree = "<group>"; };
+ C7BBC70716DDC2A600833DC9 /* NITextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NITextField.m; path = ../../src/textfield/src/NITextField.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -302,6 +302,7 @@
66832D40144214CD003E413C /* Nimbus */ = {
isa = PBXGroup;
children = (
+ C7BBC70516DDC20100833DC9 /* TextField */,
663BF6041587339A0066B814 /* Resources */,
66832D41144214DA003E413C /* Core */,
66832D7C144214EF003E413C /* CSS */,
@@ -312,8 +313,6 @@
66832D41144214DA003E413C /* Core */ = {
isa = PBXGroup;
children = (
- C7A8793916D7C99800A0C23F /* NITextField.h */,
- C7A8793A16D7C99800A0C23F /* NITextField.m */,
C7B9284916D2F736001BF61C /* NIInvocationMethods.h */,
C7B9284A16D2F736001BF61C /* NIInvocationMethods.m */,
66832DAE14434FB2003E413C /* NICommonMetrics.h */,
@@ -443,6 +442,15 @@
path = ../../thirdparty/AFNetworking/AFNetworking;
sourceTree = "<group>";
};
+ C7BBC70516DDC20100833DC9 /* TextField */ = {
+ isa = PBXGroup;
+ children = (
+ C7BBC70616DDC2A600833DC9 /* NITextField.h */,
+ C7BBC70716DDC2A600833DC9 /* NITextField.m */,
+ );
+ name = TextField;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -566,7 +574,7 @@
C7A8793616D7C8EC00A0C23F /* UITableView+NIStyleable.m in Sources */,
C7A8793716D7C8EC00A0C23F /* UITextField+NIStyleable.m in Sources */,
C7A8793816D7C8EC00A0C23F /* UIToolbar+NIStyleable.m in Sources */,
- C7A8793B16D7C99800A0C23F /* NITextField.m in Sources */,
+ C7BBC70816DDC2A600833DC9 /* NITextField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
1 examples/css/CSSDemo/resources/css/root/root.css
@@ -83,6 +83,7 @@ UIButton:highlighted
right: 30px;
-mobile-content-valign: middle;
-mobile-content-halign: center;
+ -mobile-title-insets: 20px;
}
.textField:empty {
View
144 src/Nimbus.xcodeproj/project.pbxproj
@@ -349,15 +349,18 @@
66FE7D6D13FB83620061B987 /* NITableViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 66FE7D6613FB83620061B987 /* NITableViewModel.m */; };
C743F6EA16D2652F00A933B7 /* NIUserInterfaceString.h in Headers */ = {isa = PBXBuildFile; fileRef = C743F6E816D2652F00A933B7 /* NIUserInterfaceString.h */; };
C743F6EB16D2652F00A933B7 /* NIUserInterfaceString.m in Sources */ = {isa = PBXBuildFile; fileRef = C743F6E916D2652F00A933B7 /* NIUserInterfaceString.m */; };
- C7A8791516D733F700A0C23F /* NITextField.h in Headers */ = {isa = PBXBuildFile; fileRef = C7A8791316D733F700A0C23F /* NITextField.h */; };
- C7A8791616D733F700A0C23F /* NITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8791416D733F700A0C23F /* NITextField.m */; };
C7A8791D16D7348700A0C23F /* NITextField+NIStyleable.h in Headers */ = {isa = PBXBuildFile; fileRef = C7A8791B16D7348700A0C23F /* NITextField+NIStyleable.h */; };
C7A8791F16D7348C00A0C23F /* NITextField+NIStyleable.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8791C16D7348700A0C23F /* NITextField+NIStyleable.m */; };
C7A8792216D7B96200A0C23F /* UITextField+NIStyleable.h in Headers */ = {isa = PBXBuildFile; fileRef = C7A8792016D7B96200A0C23F /* UITextField+NIStyleable.h */; };
C7A8792316D7B96200A0C23F /* UITextField+NIStyleable.m in Sources */ = {isa = PBXBuildFile; fileRef = C7A8792116D7B96200A0C23F /* UITextField+NIStyleable.m */; };
C7B9284316D2F563001BF61C /* NIInvocationMethods.h in Headers */ = {isa = PBXBuildFile; fileRef = C7B9284116D2F563001BF61C /* NIInvocationMethods.h */; };
C7B9284416D2F563001BF61C /* NIInvocationMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = C7B9284216D2F563001BF61C /* NIInvocationMethods.m */; };
C7B9284516D2F563001BF61C /* NIInvocationMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = C7B9284216D2F563001BF61C /* NIInvocationMethods.m */; };
+ C7BBC6B916DDC0DB00833DC9 /* NITextField.h in Headers */ = {isa = PBXBuildFile; fileRef = C7BBC6B716DDC0DB00833DC9 /* NITextField.h */; };
+ C7BBC6BA16DDC0DB00833DC9 /* NITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BBC6B816DDC0DB00833DC9 /* NITextField.m */; };
+ C7BBC6FE16DDC0E700833DC9 /* NITextField.h in Headers */ = {isa = PBXBuildFile; fileRef = C7BBC6B716DDC0DB00833DC9 /* NITextField.h */; };
+ C7BBC70316DDC12800833DC9 /* NITextField.h in Sources */ = {isa = PBXBuildFile; fileRef = C7BBC6B716DDC0DB00833DC9 /* NITextField.h */; };
+ C7BBC70416DDC12800833DC9 /* NITextField.m in Sources */ = {isa = PBXBuildFile; fileRef = C7BBC6B816DDC0DB00833DC9 /* NITextField.m */; };
DB3A231713FD4B8E00614220 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66A03C1A13E6E85E00B514F3 /* SenTestingKit.framework */; };
DB3A231913FD4B8E00614220 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66A03C0C13E6E85E00B514F3 /* Foundation.framework */; };
DB3A231D13FD4B8E00614220 /* libNimbusAttributedLabel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB3A230913FD4B8E00614220 /* libNimbusAttributedLabel.a */; };
@@ -980,14 +983,16 @@
66FE7D6813FB83620061B987 /* NimbusModelsTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NimbusModelsTests-Info.plist"; sourceTree = "<group>"; };
C743F6E816D2652F00A933B7 /* NIUserInterfaceString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NIUserInterfaceString.h; path = css/src/NIUserInterfaceString.h; sourceTree = SOURCE_ROOT; };
C743F6E916D2652F00A933B7 /* NIUserInterfaceString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NIUserInterfaceString.m; path = css/src/NIUserInterfaceString.m; sourceTree = SOURCE_ROOT; };
- C7A8791316D733F700A0C23F /* NITextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NITextField.h; sourceTree = "<group>"; };
- C7A8791416D733F700A0C23F /* NITextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NITextField.m; sourceTree = "<group>"; };
C7A8791B16D7348700A0C23F /* NITextField+NIStyleable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NITextField+NIStyleable.h"; path = "css/src/NITextField+NIStyleable.h"; sourceTree = SOURCE_ROOT; };
C7A8791C16D7348700A0C23F /* NITextField+NIStyleable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NITextField+NIStyleable.m"; path = "css/src/NITextField+NIStyleable.m"; sourceTree = SOURCE_ROOT; };
C7A8792016D7B96200A0C23F /* UITextField+NIStyleable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UITextField+NIStyleable.h"; path = "css/src/UITextField+NIStyleable.h"; sourceTree = SOURCE_ROOT; };
C7A8792116D7B96200A0C23F /* UITextField+NIStyleable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UITextField+NIStyleable.m"; path = "css/src/UITextField+NIStyleable.m"; sourceTree = SOURCE_ROOT; };
C7B9284116D2F563001BF61C /* NIInvocationMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIInvocationMethods.h; sourceTree = "<group>"; };
C7B9284216D2F563001BF61C /* NIInvocationMethods.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NIInvocationMethods.m; sourceTree = "<group>"; };
+ C7BBC6B516DDC0DB00833DC9 /* deps */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = deps; path = textfield/deps; sourceTree = "<group>"; };
+ C7BBC6B716DDC0DB00833DC9 /* NITextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NITextField.h; sourceTree = "<group>"; };
+ C7BBC6B816DDC0DB00833DC9 /* NITextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NITextField.m; sourceTree = "<group>"; };
+ C7BBC70216DDC0E700833DC9 /* libNimbusTextField.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNimbusTextField.a; sourceTree = BUILT_PRODUCTS_DIR; };
DB3A230913FD4B8E00614220 /* libNimbusAttributedLabel.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNimbusAttributedLabel.a; sourceTree = BUILT_PRODUCTS_DIR; };
DB3A231613FD4B8E00614220 /* NimbusAttributedLabelTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NimbusAttributedLabelTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
DB3A233213FD4BE500614220 /* NIAttributedLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIAttributedLabel.h; sourceTree = "<group>"; };
@@ -1232,6 +1237,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ C7BBC6DB16DDC0E700833DC9 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
DB3A230613FD4B8E00614220 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -1655,6 +1667,7 @@
6675722B13E765BF0076F555 /* NimbusOverview */,
663B52411445052800CC26DF /* NimbusPagingScrollView */,
6675727C13E769150076F555 /* NimbusPhotos */,
+ C7BBC6B116DDC09400833DC9 /* NimbusTextField */,
DB84BD9A13EFDE3C00DACCFE /* NimbusWebController */,
664D442E14992FE0008B4C42 /* Third Party */,
66A03C0B13E6E85E00B514F3 /* Frameworks */,
@@ -1692,6 +1705,7 @@
66A0B0A614BD1069003FA413 /* NimbusNetworkControllersTests.octest */,
66E1CDDF159161ED004DA4A2 /* libNimbusBadge.a */,
66E1CDED159161EE004DA4A2 /* NimbusBadgeTests.octest */,
+ C7BBC70216DDC0E700833DC9 /* libNimbusTextField.a */,
);
name = Products;
sourceTree = "<group>";
@@ -1778,8 +1792,6 @@
66A03C6313E6E8D100B514F3 /* NSString+NimbusCore.m */,
C7B9284116D2F563001BF61C /* NIInvocationMethods.h */,
C7B9284216D2F563001BF61C /* NIInvocationMethods.m */,
- C7A8791316D733F700A0C23F /* NITextField.h */,
- C7A8791416D733F700A0C23F /* NITextField.m */,
);
name = src;
path = core/src;
@@ -2059,6 +2071,25 @@
name = "Styleable Nimbus Views";
sourceTree = "<group>";
};
+ C7BBC6B116DDC09400833DC9 /* NimbusTextField */ = {
+ isa = PBXGroup;
+ children = (
+ C7BBC6B516DDC0DB00833DC9 /* deps */,
+ C7BBC6B616DDC0DB00833DC9 /* src */,
+ );
+ name = NimbusTextField;
+ sourceTree = "<group>";
+ };
+ C7BBC6B616DDC0DB00833DC9 /* src */ = {
+ isa = PBXGroup;
+ children = (
+ C7BBC6B716DDC0DB00833DC9 /* NITextField.h */,
+ C7BBC6B816DDC0DB00833DC9 /* NITextField.m */,
+ );
+ name = src;
+ path = textfield/src;
+ sourceTree = "<group>";
+ };
DB3A230B13FD4B8E00614220 /* NimbusAttributedLabel */ = {
isa = PBXGroup;
children = (
@@ -2238,7 +2269,6 @@
66C1D83D16B9CE90003E855B /* NIImageUtilities.h in Headers */,
66C1D8C116B9ED65003E855B /* NIButtonUtilities.h in Headers */,
C7B9284316D2F563001BF61C /* NIInvocationMethods.h in Headers */,
- C7A8791516D733F700A0C23F /* NITextField.h in Headers */,
C7A8791D16D7348700A0C23F /* NITextField+NIStyleable.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -2315,6 +2345,15 @@
66D2FE091594083800B2BEFD /* UIImageView+AFNetworking.h in Headers */,
C743F6EA16D2652F00A933B7 /* NIUserInterfaceString.h in Headers */,
C7A8792216D7B96200A0C23F /* UITextField+NIStyleable.h in Headers */,
+ C7BBC6B916DDC0DB00833DC9 /* NITextField.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ C7BBC6DD16DDC0E700833DC9 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C7BBC6FE16DDC0E700833DC9 /* NITextField.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2773,6 +2812,24 @@
productReference = 66E1CDED159161EE004DA4A2 /* NimbusBadgeTests.octest */;
productType = "com.apple.product-type.bundle";
};
+ C7BBC6BB16DDC0E700833DC9 /* NimbusTextField */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C7BBC6FF16DDC0E700833DC9 /* Build configuration list for PBXNativeTarget "NimbusTextField" */;
+ buildPhases = (
+ C7BBC6BC16DDC0E700833DC9 /* Sources */,
+ C7BBC6DB16DDC0E700833DC9 /* Frameworks */,
+ C7BBC6DC16DDC0E700833DC9 /* Run Script Generate Namespace Header */,
+ C7BBC6DD16DDC0E700833DC9 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = NimbusTextField;
+ productName = NimbusCss;
+ productReference = C7BBC70216DDC0E700833DC9 /* libNimbusTextField.a */;
+ productType = "com.apple.product-type.library.static";
+ };
DB3A230813FD4B8E00614220 /* NimbusAttributedLabel */ = {
isa = PBXNativeTarget;
buildConfigurationList = DB3A232C13FD4B8F00614220 /* Build configuration list for PBXNativeTarget "NimbusAttributedLabel" */;
@@ -2909,6 +2966,7 @@
6675728613E769150076F555 /* NimbusPhotosTests */,
6661BBCB13F1A3BB00D14F92 /* NimbusModels */,
6661BBD813F1A3BB00D14F92 /* NimbusModelsTests */,
+ C7BBC6BB16DDC0E700833DC9 /* NimbusTextField */,
DB84BD7313EFDDC900DACCFE /* NimbusWebController */,
DB84BD8013EFDDCA00DACCFE /* NimbusWebControllerTests */,
66A03CF713E6F15300B514F3 /* Nimbus */,
@@ -3358,6 +3416,20 @@
shellPath = /bin/sh;
shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
};
+ C7BBC6DC16DDC0E700833DC9 /* Run Script Generate Namespace Header */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script Generate Namespace Header";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = "/bin/sh ../scripts/generate_namespace_header";
+ shellScript = "";
+ };
DB3A231413FD4B8E00614220 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -3514,7 +3586,6 @@
66C1D83E16B9CE90003E855B /* NIImageUtilities.m in Sources */,
66C1D8C216B9ED65003E855B /* NIButtonUtilities.m in Sources */,
C7B9284416D2F563001BF61C /* NIInvocationMethods.m in Sources */,
- C7A8791616D733F700A0C23F /* NITextField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3626,6 +3697,7 @@
C743F6EB16D2652F00A933B7 /* NIUserInterfaceString.m in Sources */,
C7A8791F16D7348C00A0C23F /* NITextField+NIStyleable.m in Sources */,
C7A8792316D7B96200A0C23F /* UITextField+NIStyleable.m in Sources */,
+ C7BBC6BA16DDC0DB00833DC9 /* NITextField.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3653,6 +3725,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ C7BBC6BC16DDC0E700833DC9 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ C7BBC70316DDC12800833DC9 /* NITextField.h in Sources */,
+ C7BBC70416DDC12800833DC9 /* NITextField.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
DB3A230513FD4B8E00614220 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -4998,6 +5079,44 @@
};
name = Release;
};
+ C7BBC70016DDC0E700833DC9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 66E8CED514D08B9F00600592 /* lib.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ DSTROOT = /tmp/NimbusTextField.dst;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ NIMBUS_FEATURE_NAME = textfield;
+ PRODUCT_NAME = NimbusTextField;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ C7BBC70116DDC0E700833DC9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 66E8CED514D08B9F00600592 /* lib.xcconfig */;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DSTROOT = /tmp/NimbusTextField.dst;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
+ NIMBUS_FEATURE_NAME = textfield;
+ PRODUCT_NAME = NimbusTextField;
+ SKIP_INSTALL = YES;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
DB3A232813FD4B8E00614220 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 66E8CED514D08B9F00600592 /* lib.xcconfig */;
@@ -5404,6 +5523,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ C7BBC6FF16DDC0E700833DC9 /* Build configuration list for PBXNativeTarget "NimbusTextField" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C7BBC70016DDC0E700833DC9 /* Debug */,
+ C7BBC70116DDC0E700833DC9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
DB3A232C13FD4B8F00614220 /* Build configuration list for PBXNativeTarget "NimbusAttributedLabel" */ = {
isa = XCConfigurationList;
buildConfigurations = (
View
3 src/css/src/NITextField+NIStyleable.m
@@ -53,6 +53,9 @@ -(void)applyStyleWithRuleSet:(NICSSRuleset*)ruleSet forPseudoClass:(NSString *)p
-(void)applyNITextFieldStyleBeforeViewWithRuleSet:(NICSSRuleset*)ruleSet inDOM:(NIDOM*)dom
{
[self applyTextFieldStyleBeforeViewWithRuleSet:ruleSet inDOM:dom];
+ if (ruleSet.hasTitleInsets) {
+ self.textInsets = ruleSet.titleInsets;
+ }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
View
5 src/textfield/deps
@@ -0,0 +1,5 @@
+core
+
+[Frameworks]
+Foundation.framework
+UIKit.framework
View
5 src/core/src/NITextField.h → src/textfield/src/NITextField.h
@@ -35,4 +35,9 @@
*/
@property (nonatomic,strong) UIFont *placeholderFont;
+/**
+ * The amount to inset the text by, or zero to use default behavior
+ */
+@property (nonatomic,assign) UIEdgeInsets textInsets;
+
@end
View
10 src/core/src/NITextField.m → src/textfield/src/NITextField.m
@@ -32,4 +32,14 @@ -(void)drawPlaceholderInRect:(CGRect)rect
}
}
+-(CGRect)textRectForBounds:(CGRect)bounds
+{
+ if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, self.textInsets)) {
+ return [super textRectForBounds:bounds];
+ }
+ UIEdgeInsets i = self.textInsets;
+ return CGRectMake(bounds.origin.x + i.left, bounds.origin.y + i.top,
+ bounds.size.width - i.left - i.right, bounds.size.height - i.top - i.bottom);
+}
+
@end

0 comments on commit 9f7c0e1

Please sign in to comment.