Skip to content

Commit

Permalink
#81: PopoverController Init: Create and configure theme object and in…
Browse files Browse the repository at this point in the history
…ject it to static var (#82)
  • Loading branch information
ashavit authored and vitalys committed Aug 6, 2016
1 parent 2428b8e commit 9b8011b
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions WYPopoverController/WYPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1529,32 +1529,34 @@ - (id)init {
themeIsUpdating = YES;

WYPopoverBackgroundView *appearance = [WYPopoverBackgroundView appearance];
_theme.usesRoundedArrow = appearance.usesRoundedArrow;
_theme.dimsBackgroundViewsTintColor = appearance.dimsBackgroundViewsTintColor;
_theme.tintColor = appearance.tintColor;
_theme.outerStrokeColor = appearance.outerStrokeColor;
_theme.innerStrokeColor = appearance.innerStrokeColor;
_theme.fillTopColor = appearance.fillTopColor;
_theme.fillBottomColor = appearance.fillBottomColor;
_theme.glossShadowColor = appearance.glossShadowColor;
_theme.glossShadowOffset = appearance.glossShadowOffset;
_theme.glossShadowBlurRadius = appearance.glossShadowBlurRadius;
_theme.borderWidth = appearance.borderWidth;
_theme.arrowBase = appearance.arrowBase;
_theme.arrowHeight = appearance.arrowHeight;
_theme.outerShadowColor = appearance.outerShadowColor;
_theme.outerShadowBlurRadius = appearance.outerShadowBlurRadius;
_theme.outerShadowOffset = appearance.outerShadowOffset;
_theme.outerCornerRadius = appearance.outerCornerRadius;
_theme.minOuterCornerRadius = appearance.minOuterCornerRadius;
_theme.innerShadowColor = appearance.innerShadowColor;
_theme.innerShadowBlurRadius = appearance.innerShadowBlurRadius;
_theme.innerShadowOffset = appearance.innerShadowOffset;
_theme.innerCornerRadius = appearance.innerCornerRadius;
_theme.viewContentInsets = appearance.viewContentInsets;
_theme.overlayColor = appearance.overlayColor;
_theme.preferredAlpha = appearance.preferredAlpha;


WYPopoverTheme* theme = [WYPopoverTheme theme];
theme.usesRoundedArrow = appearance.usesRoundedArrow;
theme.dimsBackgroundViewsTintColor = appearance.dimsBackgroundViewsTintColor;
theme.tintColor = appearance.tintColor;
theme.outerStrokeColor = appearance.outerStrokeColor;
theme.innerStrokeColor = appearance.innerStrokeColor;
theme.fillTopColor = appearance.fillTopColor;
theme.fillBottomColor = appearance.fillBottomColor;
theme.glossShadowColor = appearance.glossShadowColor;
theme.glossShadowOffset = appearance.glossShadowOffset;
theme.glossShadowBlurRadius = appearance.glossShadowBlurRadius;
theme.borderWidth = appearance.borderWidth;
theme.arrowBase = appearance.arrowBase;
theme.arrowHeight = appearance.arrowHeight;
theme.outerShadowColor = appearance.outerShadowColor;
theme.outerShadowBlurRadius = appearance.outerShadowBlurRadius;
theme.outerShadowOffset = appearance.outerShadowOffset;
theme.outerCornerRadius = appearance.outerCornerRadius;
theme.minOuterCornerRadius = appearance.minOuterCornerRadius;
theme.innerShadowColor = appearance.innerShadowColor;
theme.innerShadowBlurRadius = appearance.innerShadowBlurRadius;
theme.innerShadowOffset = appearance.innerShadowOffset;
theme.innerCornerRadius = appearance.innerCornerRadius;
theme.viewContentInsets = appearance.viewContentInsets;
theme.overlayColor = appearance.overlayColor;
theme.preferredAlpha = appearance.preferredAlpha;
_theme = theme;

themeIsUpdating = NO;
themeUpdatesEnabled = YES;
Expand Down

0 comments on commit 9b8011b

Please sign in to comment.