Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 71 lines (57 sloc) 1.742 kb
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


#import "QSResizingInterfaceController.h"

#import "QSSearchObjectView.h"
#import "QSAction.h"
#import "QSTextProxy.h"
@implementation QSResizingInterfaceController

- (id)initWithWindowNibName:(NSString *)nib {
self = [super initWithWindowNibName:nib];
if (self) {
expanded = YES;
}
return self;
}

- (void)showIndirectSelector:(id)sender {
[super showIndirectSelector:sender];
[self adjustWindow:nil];
}
- (void)hideIndirectSelector:(id)sender {
[super hideIndirectSelector:sender];
[self adjustWindow:nil];
}

- (void)resetAdjustTimer {
    NSLog(@"This method is deprecated, call [self adjustWindow:nil] instead\nUsing interface: %@",[[NSUserDefaults standardUserDefaults] stringForKey:@"QSCommandInterfaceControllers"]);
    [self adjustWindow:nil];
}

- (void)adjustWindow:(id)sender {
QSAction *action = (QSAction *)[aSelector objectValue];
NSInteger argumentCount = [action argumentCount];

// NSLog(@"adjust x%d", argumentCount);
if (argumentCount == 2) {
BOOL indirectOptional = [[aSelector objectValue] indirectOptional];

// NSLog(@"adjust %d", indirectOptional);
// When the 3rd pane is not optional, show it (most likely case, so first)
if (!indirectOptional) {
[self expandWindow:sender];
return;
} else {
NSResponder *firstResponder = [[self window] firstResponder];
if (firstResponder == iSelector
|| firstResponder == [iSelector currentEditor]) {
[self expandWindow:sender];
return;
}
}
}
[self contractWindow:sender];

}

- (void)firstResponderChanged:(NSResponder *)aResponder {
    [self adjustWindow:nil];
}

- (void)expandWindow:(id)sender {
expanded = YES;
}

- (void)contractWindow:(id)sender {
expanded = NO;
}

- (BOOL)expanded {return expanded; }
@end
Something went wrong with that request. Please try again.