Permalink
Browse files

Extracted configuration settings to separate header file.

  • Loading branch information...
1 parent 5e81e9d commit 795c32b098844bd988b646ea4f867f3ee8df7636 @baspellis baspellis committed Dec 25, 2012
@@ -7,103 +7,9 @@
//
#import "PopoverView.h"
+#import "PopoverView_Configuration.h"
#import <QuartzCore/QuartzCore.h>
-#pragma mark Constants - Configure look/feel
-
-// BOX GEOMETRY
-
-//Height/width of the actual arrow
-#define kArrowHeight 12.f
-
-//padding within the box for the contentView
-#define kBoxPadding 10.f
-
-//control point offset for rounding corners of the main popover box
-#define kCPOffset 1.8f
-
-//radius for the rounded corners of the main popover box
-#define kBoxRadius 4.f
-
-//Curvature value for the arrow. Set to 0.f to make it linear.
-#define kArrowCurvature 6.f
-
-//Minimum distance from the side of the arrow to the beginning of curvature for the box
-#define kArrowHorizontalPadding 5.f
-
-//Alpha value for the shadow behind the PopoverView
-#define kShadowAlpha 0.4f
-
-//Blur for the shadow behind the PopoverView
-#define kShadowBlur 3.f;
-
-//Box gradient bg alpha
-#define kBoxAlpha 0.95f
-
-//Padding along top of screen to allow for any nav/status bars
-#define kTopMargin 50.f
-
-//margin along the left and right of the box
-#define kHorizontalMargin 10.f
-
-//padding along top of icons/images
-#define kImageTopPadding 3.f
-
-//padding along bottom of icons/images
-#define kImageBottomPadding 3.f
-
-
-// DIVIDERS BETWEEN VIEWS
-
-//Bool that turns off/on the dividers
-#define kShowDividersBetweenViews NO
-
-//color for the divider fill
-#define kDividerColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:0.15f]
-
-
-// BACKGROUND GRADIENT
-
-//bottom color white in gradient bg
-#define kGradientBottomColor [UIColor colorWithRed:0.98f green:0.98f blue:0.98f alpha:kBoxAlpha]
-
-//top color white value in gradient bg
-#define kGradientTopColor [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:kBoxAlpha]
-
-
-// TITLE GRADIENT
-
-//bool that turns off/on title gradient
-#define kDrawTitleGradient YES
-
-//bottom color white value in title gradient bg
-#define kGradientTitleBottomColor [UIColor colorWithRed:0.93f green:0.93f blue:0.93f alpha:kBoxAlpha]
-
-//top color white value in title gradient bg
-#define kGradientTitleTopColor [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:kBoxAlpha]
-
-
-// FONTS
-
-//normal text font
-#define kTextFont [UIFont fontWithName:@"HelveticaNeue" size:16.f]
-
-//normal text color
-#define kTextColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:1]
-
-//normal text alignment
-#define kTextAlignment UITextAlignmentCenter
-
-//title font
-#define kTitleFont [UIFont fontWithName:@"HelveticaNeue-Bold" size:16.f]
-
-//title text color
-#define kTitleColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:1]
-
-
-
-
-
#pragma mark - Implementation
@implementation PopoverView
@@ -0,0 +1,98 @@
+//
+// PopoverView_Configuration.h
+// popover
+//
+// Created by Bas Pellis on 12/25/12.
+// Copyright (c) 2012 Oliver Rickard. All rights reserved.
+//
+
+#pragma mark Constants - Configure look/feel
+
+// BOX GEOMETRY
+
+//Height/width of the actual arrow
+#define kArrowHeight 12.f
+
+//padding within the box for the contentView
+#define kBoxPadding 10.f
+
+//control point offset for rounding corners of the main popover box
+#define kCPOffset 1.8f
+
+//radius for the rounded corners of the main popover box
+#define kBoxRadius 4.f
+
+//Curvature value for the arrow. Set to 0.f to make it linear.
+#define kArrowCurvature 6.f
+
+//Minimum distance from the side of the arrow to the beginning of curvature for the box
+#define kArrowHorizontalPadding 5.f
+
+//Alpha value for the shadow behind the PopoverView
+#define kShadowAlpha 0.4f
+
+//Blur for the shadow behind the PopoverView
+#define kShadowBlur 3.f;
+
+//Box gradient bg alpha
+#define kBoxAlpha 0.95f
+
+//Padding along top of screen to allow for any nav/status bars
+#define kTopMargin 50.f
+
+//margin along the left and right of the box
+#define kHorizontalMargin 10.f
+
+//padding along top of icons/images
+#define kImageTopPadding 3.f
+
+//padding along bottom of icons/images
+#define kImageBottomPadding 3.f
+
+
+// DIVIDERS BETWEEN VIEWS
+
+//Bool that turns off/on the dividers
+#define kShowDividersBetweenViews NO
+
+//color for the divider fill
+#define kDividerColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:0.15f]
+
+
+// BACKGROUND GRADIENT
+
+//bottom color white in gradient bg
+#define kGradientBottomColor [UIColor colorWithRed:0.98f green:0.98f blue:0.98f alpha:kBoxAlpha]
+
+//top color white value in gradient bg
+#define kGradientTopColor [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:kBoxAlpha]
+
+
+// TITLE GRADIENT
+
+//bool that turns off/on title gradient
+#define kDrawTitleGradient YES
+
+//bottom color white value in title gradient bg
+#define kGradientTitleBottomColor [UIColor colorWithRed:0.93f green:0.93f blue:0.93f alpha:kBoxAlpha]
+
+//top color white value in title gradient bg
+#define kGradientTitleTopColor [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:kBoxAlpha]
+
+
+// FONTS
+
+//normal text font
+#define kTextFont [UIFont fontWithName:@"HelveticaNeue" size:16.f]
+
+//normal text color
+#define kTextColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:1]
+
+//normal text alignment
+#define kTextAlignment UITextAlignmentCenter
+
+//title font
+#define kTitleFont [UIFont fontWithName:@"HelveticaNeue-Bold" size:16.f]
+
+//title text color
+#define kTitleColor [UIColor colorWithRed:0.329 green:0.341 blue:0.353 alpha:1]
@@ -42,6 +42,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 0867719D1689B04F00ED150F /* PopoverView_Configuration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopoverView_Configuration.h; sourceTree = "<group>"; };
B1175C5515E3FBEE002FBFF1 /* popover.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = popover.app; sourceTree = BUILT_PRODUCTS_DIR; };
B1175C5915E3FBEE002FBFF1 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
B1175C5B15E3FBEE002FBFF1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -210,6 +211,7 @@
isa = PBXGroup;
children = (
B1175C9315E3FC13002FBFF1 /* PopoverView.h */,
+ 0867719D1689B04F00ED150F /* PopoverView_Configuration.h */,
B1175C9415E3FC13002FBFF1 /* PopoverView.m */,
);
name = PopoverView;
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0450"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
+ BuildableName = "popover.app"
+ BlueprintName = "popover"
+ ReferencedContainer = "container:popover.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "B1175C7815E3FBEE002FBFF1"
+ BuildableName = "popoverTests.octest"
+ BlueprintName = "popoverTests"
+ ReferencedContainer = "container:popover.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
+ BuildableName = "popover.app"
+ BlueprintName = "popover"
+ ReferencedContainer = "container:popover.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
+ BuildableName = "popover.app"
+ BlueprintName = "popover"
+ ReferencedContainer = "container:popover.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "B1175C5415E3FBEE002FBFF1"
+ BuildableName = "popover.app"
+ BlueprintName = "popover"
+ ReferencedContainer = "container:popover.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>

0 comments on commit 795c32b

Please sign in to comment.