diff --git a/Application/DualWindow.h b/Application/DualWindow.h new file mode 100644 index 000000000..48e32e4f7 --- /dev/null +++ b/Application/DualWindow.h @@ -0,0 +1,21 @@ +// +// InvertedToolbarWindow.h +// Cog +// +// Created by Vincent Spader on 10/31/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface DualWindow : NSWindow { + IBOutlet DualWindow *otherWindow; +} + +- (void)showWindow; + +- (BOOL)isHidden; +- (void)setHidden:(BOOL)h; + +@end diff --git a/Application/DualWindow.m b/Application/DualWindow.m new file mode 100644 index 000000000..a61584221 --- /dev/null +++ b/Application/DualWindow.m @@ -0,0 +1,55 @@ +// +// InvertedToolbarWindow.m +// Cog +// +// Created by Vincent Spader on 10/31/07. +// Copyright 2007 __MyCompanyName__. All rights reserved. +// + +#import "DualWindow.h" + + +@implementation DualWindow + +- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation +{ + self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation]; + if (self) + { + } + + return self; +} + +- (NSString *)hiddenDefaultsKey +{ + if ([self frameAutosaveName]) + { + return [[self frameAutosaveName] stringByAppendingString:@" Window Content Height"]; + } + + return nil; +} + +- (BOOL)isHidden +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:[self hiddenDefaultsKey]]; +} + +- (void)setHidden:(BOOL)h +{ + [[NSUserDefaults standardUserDefaults] setBool:h forKey:[self hiddenDefaultsKey]]; +} + +- (void)toggleToolbarShown:(id)sender +{ + [otherWindow showWindow]; +} + +- (void)showWindow +{ + [otherWindow close]; + [self makeKeyAndOrderFront:self]; +} + +@end