BathyScapheのアイコンセット生成&適用ツール
修订版 | 19a8eed15c12246b00b6ad29d2d06499acd68881 (tree) |
---|---|
时间 | 2012-05-30 22:32:14 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
[Mod] delegateメソッド追加
@@ -45,6 +45,7 @@ typedef enum { | ||
45 | 45 | |
46 | 46 | @interface NSObject (ColorSetDelegate) |
47 | 47 | |
48 | +- (void)willChangeColorSet:(ColorSet *)set; | |
48 | 49 | - (void)didChangeColorSet:(ColorSet *)set; |
49 | 50 | |
50 | 51 | @end |
@@ -75,6 +75,10 @@ enum { | ||
75 | 75 | } |
76 | 76 | - (void)setThreadsListColor:(NSColor *)color |
77 | 77 | { |
78 | + if(delegate && [delegate respondsToSelector:@selector(willChangeColorSet:)]) { | |
79 | + [delegate willChangeColorSet:self]; | |
80 | + } | |
81 | + | |
78 | 82 | id temp = threadsListColor; |
79 | 83 | threadsListColor = [color retain]; |
80 | 84 | [temp release]; |
@@ -83,22 +87,38 @@ enum { | ||
83 | 87 | color = [[self class] defaultThreadsListColor]; |
84 | 88 | } |
85 | 89 | [threadsListColorWell setColor:color]; |
90 | + | |
91 | + if(delegate && [delegate respondsToSelector:@selector(didChangeColorSet:)]) { | |
92 | + [delegate didChangeColorSet:self]; | |
93 | + } | |
86 | 94 | } |
87 | 95 | - (void)setIncludeColors:(BOOL)flag |
88 | 96 | { |
97 | + if(delegate && [delegate respondsToSelector:@selector(willChangeColorSet:)]) { | |
98 | + [delegate willChangeColorSet:self]; | |
99 | + } | |
100 | + | |
89 | 101 | isIncludeColors = flag; |
90 | 102 | [includeSetCheck setState: flag ? NSOnState : NSOffState]; |
91 | 103 | [self updateUI]; |
92 | 104 | |
93 | - [delegate didChangeColorSet:self]; | |
105 | + if(delegate && [delegate respondsToSelector:@selector(didChangeColorSet:)]) { | |
106 | + [delegate didChangeColorSet:self]; | |
107 | + } | |
94 | 108 | } |
95 | 109 | - (void)setUseStripe:(BOOL)flag |
96 | 110 | { |
111 | + if(delegate && [delegate respondsToSelector:@selector(willChangeColorSet:)]) { | |
112 | + [delegate willChangeColorSet:self]; | |
113 | + } | |
114 | + | |
97 | 115 | isUseStripe = flag; |
98 | 116 | [useStripeCheck setState: flag ? NSOnState : NSOffState]; |
99 | 117 | [self updateUI]; |
100 | 118 | |
101 | - [delegate didChangeColorSet:self]; | |
119 | + if(delegate && [delegate respondsToSelector:@selector(didChangeColorSet:)]) { | |
120 | + [delegate didChangeColorSet:self]; | |
121 | + } | |
102 | 122 | } |
103 | 123 | |
104 | 124 | - (BOOL)isThreadsListColorDefault |
@@ -330,8 +350,6 @@ enum { | ||
330 | 350 | default: |
331 | 351 | return; |
332 | 352 | } |
333 | - | |
334 | - [delegate didChangeColorSet:self]; | |
335 | 353 | } |
336 | 354 | |
337 | 355 | - (IBAction)revertColor:(id)sender |
@@ -350,8 +368,6 @@ enum { | ||
350 | 368 | default: |
351 | 369 | return; |
352 | 370 | } |
353 | - | |
354 | - [delegate didChangeColorSet:self]; | |
355 | 371 | } |
356 | 372 | |
357 | 373 | - (IBAction)toggleIncludeColorSet:(id)sender |
@@ -382,8 +398,6 @@ enum { | ||
382 | 398 | [self setIncludeColors:[[dict objectForKey:IncludeColorsKey] boolValue]]; |
383 | 399 | [self setUseStripe:[[dict objectForKey:UseStripeKey] boolValue]]; |
384 | 400 | |
385 | - [delegate didChangeColorSet:self]; | |
386 | - | |
387 | 401 | return YES; |
388 | 402 | } |
389 | 403 | - (NSString *)identifier |