-
Notifications
You must be signed in to change notification settings - Fork 5
/
PWTheme.m
723 lines (540 loc) · 18.6 KB
/
PWTheme.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
//
// ProWidgets
//
// 1.0.0
//
// Created by Alan Yip on 18 Jan 2014
// Copyright 2014 Alan Yip. All rights reserved.
//
#import "PWTheme.h"
#import "PWController.h"
#import "PWWidgetController.h"
#import "PWContainerView.h"
#import "PWThemableTableViewCell.h"
#import "PWWidget.h"
#import "PWWidgetNavigationController.h"
static NSDictionary *supportedColorString = nil;
@implementation PWTheme
+ (void)load {
if (supportedColorString != nil) return;
supportedColorString = [@{
// built-in colors
@"black": @"blackColor",
@"darkgray": @"darkGrayColor",
@"lightgray": @"lightGrayColor",
@"white": @"whiteColor",
@"gray": @"grayColor",
@"red": @"redColor",
@"green": @"greenColor",
@"blue": @"blueColor",
@"cyan": @"cyanColor",
@"yellow": @"yellowColor",
@"magenta": @"magentaColor",
@"orange": @"orangeColor",
@"purple": @"purpleColor",
@"brown": @"brownColor",
@"clear": @"clearColor",
// system colors
@"lighttext": @"lightTextColor",
@"darktext": @"darkTextColor",
// extra supported words
@"transparent": @"clearColor"
} copy];
}
//////////////////////////////////////////////////////////////////////
/**
* Initialization
**/
- (instancetype)initWithName:(NSString *)name bundle:(NSBundle *)bundle widget:(PWWidget *)widget disabledBlur:(BOOL)disabledBlur {
if ((self = [super init])) {
self.name = name;
self.bundle = bundle;
self.widget = widget;
self.disabledBlur = disabledBlur;
}
return self;
}
//////////////////////////////////////////////////////////////////////
/**
* Public API
**/
- (UIImage *)imageNamed:(NSString *)name {
return [UIImage imageNamed:name inBundle:_bundle];
}
- (UIImage *)imageNamed:(NSString *)name withCapInsets:(UIEdgeInsets)insets {
return [[self imageNamed:name] resizableImageWithCapInsets:insets];
}
+ (UIColor *)parseColorString:(NSString *)string {
NSString *lowercaseString = [[string lowercaseString] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
// supported color string
NSString *selectorName = [supportedColorString objectForKey:lowercaseString];
if (selectorName != nil) {
UIColor *color = [UIColor performSelector:NSSelectorFromString(selectorName)];
LOG(@"PWThemePlistParser: Parsed '%@' as built-in color.", lowercaseString);
return color;
}
// #RGB / #RRGGBB
if ([lowercaseString hasPrefix:@"#"]) {
NSString *hex = [lowercaseString stringByReplacingOccurrencesOfString:@"#" withString:@""];
if ([hex length] == 3 || [hex length] == 6) {
// expand to full form
if([hex length] == 3) {
hex = [NSString stringWithFormat:@"%@%@%@%@%@%@",
[hex substringWithRange:NSMakeRange(0, 1)],[hex substringWithRange:NSMakeRange(0, 1)],
[hex substringWithRange:NSMakeRange(1, 1)],[hex substringWithRange:NSMakeRange(1, 1)],
[hex substringWithRange:NSMakeRange(2, 1)],[hex substringWithRange:NSMakeRange(2, 1)]];
}
unsigned int hexValue;
[[NSScanner scannerWithString:hex] scanHexInt:&hexValue];
CGFloat red = ((hexValue >> 16) & 0xFF) / 255.0f;
CGFloat green = ((hexValue >> 8) & 0xFF) / 255.0f;
CGFloat blue = (hexValue & 0xFF) / 255.0f;
LOG(@"PWThemePlistParser: Parsed '%@' as %.2f, %.2f, %.2f, 1.0", lowercaseString, red, green, blue);
return [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
}
}
// rgb(255, 0, 0)
// rgba(255, 0, 0, 1.0)
// hsl(100, 10%, 10%)
// hsla(100, 10%, 10%, 0.5)
if ([lowercaseString hasPrefix:@"rgb"] || [lowercaseString hasPrefix:@"hsl"]) {
// ^(rgba?|hsla?)\(\s*(-?[\d\.]+%?)\s*,\s*([\d\.]+%?)\s*,\s*([\d\.]+%?)\s*(?:,\s*([\d\.]+%?)\s*)?\s*\)$
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^(rgba?|hsla?)\\(\\s*(-?[\\d\\.]+%?)\\s*,\\s*([\\d\\.]+%?)\\s*,\\s*([\\d\\.]+%?)\\s*(?:,\\s*([\\d\\.]+%?)\\s*)?\\s*\\)$"
options:0
error:nil];
NSTextCheckingResult *match = [regex firstMatchInString:lowercaseString
options:0
range:NSMakeRange(0, [lowercaseString length])];
// invalid format
if (match == nil) return nil;
typedef enum {
RGB,
RGBA,
HSL,
HSLA
} ColorFormat;
ColorFormat format = RGB;
CGFloat value1 = 0.0;
CGFloat value2 = 0.0;
CGFloat value3 = 0.0;
CGFloat alpha = 1.0;
// the first range is the full length of source string
for (unsigned int i = 0; i < [match numberOfRanges] - 1; i++) {
NSRange range = [match rangeAtIndex:i + 1];
if (range.location == NSNotFound) continue;
NSString *part = [lowercaseString substringWithRange:range];
if (i == 0) {
// first match represents rgb/rgba/hsl
if ([part isEqualToString:@"rgba"]) format = RGBA;
else if ([part isEqualToString:@"hsl"]) format = HSL;
else if ([part isEqualToString:@"hsla"]) format = HSLA;
else format = RGB;
} else {
CGFloat doubleValue = [part doubleValue];
if (i == 4 && (format == RGBA || format == HSLA)) {
if (doubleValue < 0.0)
doubleValue = 0.0;
else if (doubleValue > 1.0)
doubleValue = 1.0;
alpha = doubleValue;
} else if (i <= 3) {
if (format == RGB || format == RGBA) {
// convert percentage to decimal
if ([part hasSuffix:@"%"])
doubleValue = (doubleValue > 100.0 ? 100.0 : doubleValue) / 100.0;
else
doubleValue = (doubleValue > 255.0 ? 255.0 : doubleValue) / 255.0;
// prevent negative number
if (doubleValue < 0.0)
doubleValue = 0.0;
} else if (format == HSL || format == HSLA) {
if (i == 1 && ![part hasSuffix:@"%"]) {
doubleValue = ((((int)doubleValue % 360) + 360) % 360) / 360.0;
} else if ((i == 2 || i == 3) && [part hasSuffix:@"%"]) {
doubleValue = (doubleValue > 100.0 ? 100.0 : doubleValue) / 100.0;
}
}
if (i == 1) value1 = doubleValue;
else if (i == 2) value2 = doubleValue;
else if (i == 3) value3 = doubleValue;
} else {
break;
}
}
}
LOG(@"PWThemePlistParser: Parsed '%@' as %.2f, %.2f, %.2f, %.2f", lowercaseString, value1, value2, value3, alpha);
if (format == RGB || format == RGBA) {
return [UIColor colorWithRed:value1 green:value2 blue:value3 alpha:alpha];
} else if (format == HSL || format == HSLA) {
return [UIColor colorWithHue:value1 saturation:value2 brightness:value3 alpha:alpha];
}
}
return nil;
}
+ (NSString *)hexCodeFromColor:(UIColor *)color {
CGFloat r, g, b;
if ([color getRed:&r green:&g blue:&b alpha:NULL]) {
unsigned int rint = (unsigned int)(r * 255);
unsigned int gint = (unsigned int)(g * 255);
unsigned int bint = (unsigned int)(b * 255);
return [NSString stringWithFormat:@"%02x%02x%02x", rint, gint, bint];
}
CGFloat w;
if ([color getWhite:&w alpha:NULL]) {
unsigned int wint = (unsigned int)(w * 255);
return [NSString stringWithFormat:@"%02x%02x%02x", wint, wint, wint];
}
return nil;
}
+ (NSString *)RGBAFromColor:(UIColor *)color {
CGFloat r, g, b, a;
if ([color getRed:&r green:&g blue:&b alpha:&a]) {
unsigned int rint = (unsigned int)(r * 255);
unsigned int gint = (unsigned int)(g * 255);
unsigned int bint = (unsigned int)(b * 255);
return [NSString stringWithFormat:@"rgba(%u, %u, %u, %f)", rint, gint, bint, a];
}
CGFloat w;
if ([color getWhite:&w alpha:&a]) {
unsigned int wint = (unsigned int)(w * 255);
return [NSString stringWithFormat:@"rgba(%u, %u, %u, %f)", wint, wint, wint, a];
}
return nil;
}
+ (UIImage *)imageFromColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
+ (UIImage *)tintImage:(UIImage *)image withColor:(UIColor *)color {
CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, image.scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGAffineTransform transform = CGAffineTransformIdentity;
transform = CGAffineTransformScale(transform, 1.0, -1.0);
transform = CGAffineTransformTranslate(transform, 0.0, -image.size.height);
CGContextConcatCTM(context, transform);
CGRect flippedRect = CGRectApplyAffineTransform(rect, transform);
CGContextSetBlendMode(context, kCGBlendModeNormal);
[color setFill];
CGContextFillRect(context, flippedRect);
CGContextSetBlendMode(context, kCGBlendModeDestinationIn);
CGContextDrawImage(context, flippedRect, image.CGImage);
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return result;
}
+ (UIColor *)adjustColorBrightness:(UIColor *)color colorAdjustment:(CGFloat)adjustment alphaMultiplier:(CGFloat)alphaMultiplier {
#define ADJUST(x) (MAX(0.0, MIN((x) + adjustment, 1.0)))
CGFloat r, g, b, a;
if ([color getRed:&r green:&g blue:&b alpha:&a]) {
return [UIColor colorWithRed:ADJUST(r)
green:ADJUST(g)
blue:ADJUST(b)
alpha:MAX(0.0, MIN(a * alphaMultiplier, 1.0))];
}
CGFloat w;
if ([color getWhite:&w alpha:&a]) {
return [UIColor colorWithWhite:ADJUST(w)
alpha:MAX(0.0, MIN(a * alphaMultiplier, 1.0))];
}
#undef ADJUST
return color;
}
#define COLOR_ADJUSTMENT_AMOUNT 30.0
+ (UIColor *)darkenColor:(UIColor *)color {
return [self adjustColorBrightness:color colorAdjustment:-COLOR_ADJUSTMENT_AMOUNT/255.0 alphaMultiplier:1.0];
}
+ (UIColor *)lightenColor:(UIColor *)color {
return [self adjustColorBrightness:color colorAdjustment:COLOR_ADJUSTMENT_AMOUNT/255.0 alphaMultiplier:1.0];
}
+ (UIColor *)translucentColor:(UIColor *)color {
return [self adjustColorBrightness:color colorAdjustment:0.0 alphaMultiplier:.5];
}
//////////////////////////////////////////////////////////////////////
- (PWBackgroundView *)backgroundView {
return self.widget.widgetController.backgroundView;
}
- (PWContainerView *)containerView {
return self.widget.widgetController.containerView;
}
- (UINavigationController *)navigationController {
return self.widget.navigationController;
}
- (UINavigationBar *)navigationBar {
return self.widget.navigationController.navigationBar;
}
- (UIColor *)preferredTintColor {
return self.widget.preferredTintColor;
}
- (UIColor *)preferredBarTextColor {
return self.widget.preferredBarTextColor;
}
/**
* Private methods
**/
- (void)_configureAppearance {
PWContainerView *containerView = self.containerView;
UINavigationBar *bar = self.navigationBar;
// reset sheet background
UIImageView *containerBackgroundView = self.containerView.containerBackgroundView;
containerBackgroundView.image = nil;
containerBackgroundView.backgroundColor = [UIColor clearColor];
// update sheet background
UIImage *backgroundImage = [self sheetBackgroundImageForOrientation:[PWController currentOrientation]];
UIColor *backgroundColor = [self sheetBackgroundColor];
if (backgroundImage != nil)
containerBackgroundView.image = backgroundImage;
else if (backgroundColor != nil)
containerBackgroundView.backgroundColor = backgroundColor;
// corner radius
containerView.layer.cornerRadius = [self cornerRadius];
// configure navigation bar
bar.titleTextAttributes = @{ UITextAttributeTextColor:[self navigationTitleTextColor] };
bar.tintColor = [self navigationButtonTextColor];
bar.barTintColor = [self navigationBarBackgroundColor];
[bar setBackgroundImage:[self navigationBarBackgroundImageForOrientation:PWWidgetOrientationPortrait] forBarMetrics:UIBarMetricsDefault];
[bar setBackgroundImage:[self navigationBarBackgroundImageForOrientation:PWWidgetOrientationLandscape] forBarMetrics:UIBarMetricsLandscapePhone];
}
//////////////////////////////////////////////////////////////////////
/**
* Override these methods to configure the theme
**/
- (void)enterSnapshotMode {}
- (void)exitSnapshotMode {}
// Setup Theme
// for themers to setup the theme
// e.g. set background image
// NOT necessary to adjust sizes yet. DO it in adjustLayout
- (void)setupTheme {}
// Remove Theme
// for themers to remove all subviews added in setupTheme
- (void)removeTheme {}
// Adjust Layout
// for themers to adjust the size and position of different
// UI elements
- (void)adjustLayout {}
//////////////////////////////////////////////////////////////////////
/**
* Override these methods to customize the theme
**/
///////////////////////////
////////// Style //////////
///////////////////////////
- (BOOL)wantsDarkKeyboard {
return NO;
}
////////////////////////////
////////// Images //////////
////////////////////////////
- (UIImage *)sheetBackgroundImageForOrientation:(PWWidgetOrientation)orientation {
return nil;
}
- (UIImage *)navigationBarBackgroundImageForOrientation:(PWWidgetOrientation)orientation {
return nil;
}
- (UIImage *)cellBackgroundImageForOrientation:(PWWidgetOrientation)orientation {
return nil;
}
- (UIImage *)cellSelectedBackgroundImageForOrientation:(PWWidgetOrientation)orientation {
return nil;
}
////////////////////////////
////////// Colors //////////
////////////////////////////
- (UIColor *)tintColor {
return [self.class defaultTintColor];
}
- (UIColor *)sheetForegroundColor {
return [self.class defaultSheetForegroundColor];
}
- (UIColor *)sheetBackgroundColor {
return [self.class defaultSheetBackgroundColor];
}
- (UIColor *)navigationBarBackgroundColor {
return [self.class defaultNavigationBarBackgroundColor];
}
- (UIColor *)navigationTitleTextColor {
return [self.class defaultNavigationTitleTextColor];
}
- (UIColor *)navigationButtonTextColor {
return [self.class defaultNavigationButtonTextColor];
}
- (UIColor *)cellSeparatorColor {
return [self.class defaultCellSeparatorColor];
}
- (UIColor *)cellBackgroundColor {
return [self.class defaultCellBackgroundColor];
}
- (UIColor *)cellTitleTextColor {
return [self.class defaultCellTitleTextColor];
}
- (UIColor *)cellValueTextColor {
return [self.class defaultCellValueTextColor];
}
- (UIColor *)cellButtonTextColor {
return [self.class defaultCellButtonTextColor];
}
- (UIColor *)cellInputTextColor {
return [self.class defaultCellInputTextColor];
}
- (UIColor *)cellInputPlaceholderTextColor {
return [self.class defaultCellInputPlaceholderTextColor];
}
- (UIColor *)cellPlainTextColor {
return [self.class defaultCellPlainTextColor];
}
- (UIColor *)cellSelectedBackgroundColor {
return [self.class defaultCellSelectedBackgroundColor];
}
- (UIColor *)cellSelectedTitleTextColor {
return [self.class defaultCellSelectedTitleTextColor];
}
- (UIColor *)cellSelectedValueTextColor {
return [self.class defaultCellSelectedValueTextColor];
}
- (UIColor *)cellSelectedButtonTextColor {
return [self.class defaultCellSelectedButtonTextColor];
}
- (UIColor *)cellHeaderFooterViewBackgroundColor {
return [self.class defaultCellHeaderFooterViewBackgroundColor];
}
- (UIColor *)cellHeaderFooterViewTitleTextColor {
return [self.class defaultCellHeaderFooterViewTitleTextColor];
}
- (UIColor *)switchThumbColor {
return [self.class defaultSwitchThumbColor];
}
- (UIColor *)switchOnColor {
return [self.class defaultSwitchOnColor];
}
- (UIColor *)switchOffColor {
return [self.class defaultSwitchOffColor];
}
//////////////////////////////////////////
////////// Sizes and Dimensions //////////
//////////////////////////////////////////
- (CGFloat)cornerRadius {
return [self.class defaultCornerRadius];
}
- (CGFloat)heightOfCellOfType:(PWWidgetCellType)type forOrientation:(PWWidgetOrientation)orientation {
return [self.class defaultHeightOfCellOfType:type forOrientation:orientation];
}
//////////////////////////////////////////////////////////////////////
/**
* Default theme values
**/
////////////////////////////
////////// Colors //////////
////////////////////////////
+ (UIColor *)defaultTintColor {
return nil;
}
+ (UIColor *)defaultSheetForegroundColor {
return [UIColor blackColor];
}
+ (UIColor *)defaultSheetBackgroundColor {
return [UIColor whiteColor];
}
+ (UIColor *)defaultNavigationBarBackgroundColor {
return [UIColor whiteColor];
}
+ (UIColor *)defaultNavigationTitleTextColor {
return [UIColor blackColor];
}
+ (UIColor *)defaultNavigationButtonTextColor {
return [self systemBlueColor];
}
+ (UIColor *)defaultCellSeparatorColor {
return [UIColor colorWithWhite:0 alpha:0.2];
}
+ (UIColor *)defaultCellBackgroundColor {
return [UIColor clearColor];
}
+ (UIColor *)defaultCellTitleTextColor {
return [UIColor blackColor];
}
+ (UIColor *)defaultCellValueTextColor {
return [UIColor colorWithWhite:.5 alpha:1.0];
}
+ (UIColor *)defaultCellButtonTextColor {
return [self systemBlueColor];
}
+ (UIColor *)defaultCellInputTextColor {
return [UIColor blackColor];
}
+ (UIColor *)defaultCellInputPlaceholderTextColor {
return [UIColor colorWithWhite:0 alpha:.2];
}
+ (UIColor *)defaultCellPlainTextColor {
return [UIColor colorWithWhite:.5 alpha:1.0];
}
+ (UIColor *)defaultCellSelectedBackgroundColor {
return [UIColor colorWithWhite:.9 alpha:1.0];
}
+ (UIColor *)defaultCellSelectedTitleTextColor {
return [UIColor blackColor];
}
+ (UIColor *)defaultCellSelectedValueTextColor {
return [UIColor colorWithWhite:.5 alpha:1.0]; // same as defaultCellValueTextColor
}
+ (UIColor *)defaultCellSelectedButtonTextColor {
return [self systemBlueColor];
}
+ (UIColor *)defaultCellHeaderFooterViewBackgroundColor {
return [UIColor colorWithWhite:.85 alpha:1.0];
}
+ (UIColor *)defaultCellHeaderFooterViewTitleTextColor {
return [UIColor colorWithWhite:.5 alpha:1.0];
}
+ (UIColor *)defaultSwitchThumbColor {
return nil;
}
+ (UIColor *)defaultSwitchOnColor {
return nil;
}
+ (UIColor *)defaultSwitchOffColor {
return nil;
}
//////////////////////////////////////////
////////// Sizes and Dimensions //////////
//////////////////////////////////////////
+ (CGFloat)defaultCornerRadius {
return 0.0;
}
+ (CGFloat)defaultHeightOfCellOfType:(PWWidgetCellType)type forOrientation:(PWWidgetOrientation)orientation {
CGFloat baseHeight;
if (orientation == PWWidgetOrientationLandscape && ![PWController isIPad]) {
baseHeight = 36.0;
} else {
baseHeight = 44.0;
}
switch (type) {
case PWWidgetCellTypeNormal:
default:
return baseHeight;
case PWWidgetCellTypeTextArea:
return baseHeight * 3;
}
}
//////////////////////////////////////////////////////////////////////
/**
* System colors
**/
+ (UIColor *)systemBlueColor {
return [UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0]; // default iOS 7 blue
}
//////////////////////////////////////////////////////////////////////
- (void)dealloc {
DEALLOCLOG;
RELEASE(_name)
RELEASE(_bundle)
_widget = nil;
[super dealloc];
}
@end