Converted these images to PNG, saving a handful of bytes per image
[adiumx.git] / Utilities / AdiumIBPalette / AITextColorPreviewViewInspector.m
blob98936965728bb923e2ddd165d3a1120d1f14e4ca
1 //
2 //  AITextColorPreviewViewInspector.m
3 //  AdiumIBPalette
4 //
5 //  Created by Peter Hosey on 2006-05-11.
6 //  Copyright 2006 The Adium Project. All rights reserved.
7 //
9 #import "AITextColorPreviewViewInspector.h"
11 @implementation AITextColorPreviewViewInspector
13 - (id) init
15         if((self = [super init])) {
16                 [NSBundle loadNibNamed:@"AITextColorPreviewViewInspector" owner:self];
17         }
18         return self;
21 /* We're supposed to override this, but with Bindings, we don't need to.
22    Bindings in IB inspectors are kind of flaky, though, so I'm leaving this here for now, in case we need to use it.
23    -- boredzo
25 - (void)ok:(id)sender
27         [super ok:sender];
31 - (void)revert:(id)sender
33         [self willChangeValueForKey:@"previewText"];
34         [self  didChangeValueForKey:@"previewText"];
35         [self willChangeValueForKey:@"textColor"];
36         [self  didChangeValueForKey:@"textColor"];
37         [self willChangeValueForKey:@"textShadowColor"];
38         [self  didChangeValueForKey:@"textShadowColor"];
39         [self willChangeValueForKey:@"backgroundColor"];
40         [self  didChangeValueForKey:@"backgroundColor"];
41         [self willChangeValueForKey:@"backgroundGradientColor"];
42         [self  didChangeValueForKey:@"backgroundGradientColor"];
43         [self willChangeValueForKey:@"textShadowEnabled"];
44         [self  didChangeValueForKey:@"textShadowEnabled"];
45         [self willChangeValueForKey:@"backgroundEnabled"];
46         [self  didChangeValueForKey:@"backgroundEnabled"];
48         [super revert:sender];
51 #pragma Bindings accessors
53 //All of these forward data to/from the preview view.
55 - (NSString *) previewText {
56         return [[self object] previewText];
58 - (void) setPreviewText:(NSString *)newPreviewText {
59         [[self object] setPreviewText:newPreviewText];
61         //Bug in IB's Bindings support (if it has any): We can't call -ok: from here because this is a text field.
62         //Instead, we call it after a delay.
63 //      [super ok:nil];
64         [self performSelector:@selector(ok:)
65                            withObject:nil
66                            afterDelay:0.1];
69 - (NSColor *) textColor {
70         return [[self object] textColor];
72 - (void) setTextColor:(NSColor *)newTextColor {
73         [[self object] setTextColor:newTextColor];
74         [super ok:nil];
77 - (NSColor *) textShadowColor {
78         return [[self object] textShadowColor];
80 - (void) setTextShadowColor:(NSColor *)newTextShadowColor {
81         [[self object] setTextShadowColor:newTextShadowColor];
82         [super ok:nil];
85 - (NSColor *) backgroundColor {
86         return [[self object] backgroundColor];
88 - (void) setBackgroundColor:(NSColor *)newBackgroundColor {
89         [[self object] setBackgroundColor:newBackgroundColor];
90         [super ok:nil];
93 - (NSColor *) backgroundGradientColor {
94         return [[self object] backgroundGradientColor];
96 - (void) setBackgroundGradientColor:(NSColor *)newBackgroundGradientColor {
97         [[self object] setBackgroundGradientColor:newBackgroundGradientColor];
98         [super ok:nil];
101 - (BOOL) textShadowEnabled {
102         return [[self object] textShadowEnabled];
104 - (void) setTextShadowEnabled:(BOOL)flag {
105         [[self object] setTextShadowEnabled:flag];
106         [super ok:nil];
109 - (BOOL) backgroundEnabled {
110         return [[self object] backgroundEnabled];
112 - (void) setBackgroundEnabled:(BOOL)flag {
113         [[self object] setBackgroundEnabled:flag];
114         [super ok:nil];
117 @end
119 @implementation AITextColorPreviewView (AdiumIBPaletteInspector)
121 - (NSString *)inspectorClassName {
122         return @"AITextColorPreviewViewInspector";
125 @end