| 3 |
#import "MainToolbarSource.h" |
#import "MainToolbarSource.h" |
| 4 |
#import "IconedCell.h" |
#import "IconedCell.h" |
| 5 |
#import "ComposeToolbarSource.h" |
#import "ComposeToolbarSource.h" |
| 6 |
|
#import "PreferenceToolbarSource.h" |
| 7 |
|
|
| 8 |
@implementation MainController |
@implementation MainController |
| 9 |
-(void)awakeFromNib{ |
-(void)awakeFromNib{ |
| 11 |
NSToolbar *toolbar; |
NSToolbar *toolbar; |
| 12 |
MainToolbarSource *mainToolbarSource; |
MainToolbarSource *mainToolbarSource; |
| 13 |
ComposeToolbarSource *composeToolbarSource; |
ComposeToolbarSource *composeToolbarSource; |
| 14 |
|
PreferenceToolbarSource *preferenceToolbarSource; |
| 15 |
|
|
| 16 |
|
[preferenceWindow setContentSize:[generalPref bounds].size]; |
| 17 |
|
[[preferenceWindow contentView] addSubview:generalPref]; |
| 18 |
|
|
| 19 |
ds = [[DummyOutlineDataSource alloc] init]; |
ds = [[DummyOutlineDataSource alloc] init]; |
| 20 |
[folderTree setDataSource:ds]; |
[folderTree setDataSource:ds]; |
| 31 |
[composeWindow setToolbar:toolbar]; |
[composeWindow setToolbar:toolbar]; |
| 32 |
[toolbar release]; |
[toolbar release]; |
| 33 |
|
|
| 34 |
|
toolbar = [[NSToolbar alloc] initWithIdentifier:@"preferenceToolBar"]; |
| 35 |
|
preferenceToolbarSource = [[PreferenceToolbarSource alloc] initWithController:self]; |
| 36 |
|
[toolbar setDelegate:preferenceToolbarSource]; |
| 37 |
|
[preferenceWindow setToolbar:toolbar]; |
| 38 |
|
[toolbar release]; |
| 39 |
|
|
| 40 |
} |
} |
| 41 |
- (void)applicationDidFinishLaunching:(NSNotification*)notif |
- (void)applicationDidFinishLaunching:(NSNotification*)notif |
| 42 |
{ |
{ |
| 56 |
-(IBAction)showPreference:(id)sender{ |
-(IBAction)showPreference:(id)sender{ |
| 57 |
[preferenceWindow makeKeyAndOrderFront:nil]; |
[preferenceWindow makeKeyAndOrderFront:nil]; |
| 58 |
} |
} |
| 59 |
|
-(IBAction)selectPreferenceTab:(id)sender{ |
| 60 |
|
NSView *contentView; |
| 61 |
|
NSRect rect; |
| 62 |
|
float toolbarHeight; |
| 63 |
|
NSString *identifier = [sender itemIdentifier]; |
| 64 |
|
contentView = [preferenceWindow contentView]; |
| 65 |
|
|
| 66 |
|
toolbarHeight = [preferenceWindow frame].size.height - [contentView frame].size.height; |
| 67 |
|
NSLog(@"toolbarHeight = %f", toolbarHeight); |
| 68 |
|
|
| 69 |
|
if([identifier isEqual:@"general_tab"]){ |
| 70 |
|
rect.origin = NSMakePoint([preferenceWindow frame].origin.x, |
| 71 |
|
[preferenceWindow frame].origin.y - ([generalPref bounds].size.height - [contentView bounds].size.height) - toolbarHeight); |
| 72 |
|
rect.size = [generalPref bounds].size; |
| 73 |
|
[preferenceWindow setFrame:rect display:YES animate:YES]; |
| 74 |
|
[contentView replaceSubview:accountPref with:generalPref]; |
| 75 |
|
}else{ |
| 76 |
|
rect.origin = NSMakePoint([preferenceWindow frame].origin.x, |
| 77 |
|
[preferenceWindow frame].origin.y - ([accountPref bounds].size.height - [contentView bounds].size.height) - toolbarHeight); |
| 78 |
|
rect.size = [accountPref bounds].size; |
| 79 |
|
[preferenceWindow setFrame:rect display:YES animate:YES]; |
| 80 |
|
[contentView replaceSubview:generalPref with:accountPref]; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
} |
| 84 |
|
|
| 85 |
@end |
@end |