Skip to content
Browse files

Removed auto layout. Causing too many headaches.

  • Loading branch information...
1 parent e0be7e7 commit 292311466651c899d9b602800aed33f8dd48f9fa @beelsebob committed Mar 11, 2013
Showing with 82 additions and 1,948 deletions.
  1. +3 −2 Stash/STAMainWindowController.h
  2. +35 −3 Stash/STAMainWindowController.m
  3. +44 −1,943 Stash/en.lproj/MainMenu.xib
View
5 Stash/STAMainWindowController.h
@@ -13,7 +13,7 @@
#import "STAPreferencesController.h"
-@interface STAMainWindowController : NSWindowController <NSWindowDelegate>
+@interface STAMainWindowController : NSWindowController <NSWindowDelegate, NSSplitViewDelegate>
@property (strong, nonatomic) STADocSetStore *docsetStore;
@@ -22,11 +22,12 @@
@property (strong) IBOutlet NSTextField *titleView;
@property (strong) IBOutlet NSSearchField *searchField;
@property (weak) IBOutlet NSMatrix *searchMethodSelector;
+@property (weak) IBOutlet NSView *findBar;
@property (weak) IBOutlet NSSearchField *inPageSearchField;
@property (weak) IBOutlet NSTableView *indexingDocsetsView;
@property (weak) IBOutlet NSScrollView *indexingDocsetsContainer;
@property (weak) IBOutlet NSView *docsetsNotFoundView;
-@property (weak) IBOutlet NSLayoutConstraint *findBarHeightConstraint;
+@property (weak) IBOutlet NSView *searchColumn;
@property (strong) STAPreferencesController *preferencesController;
View
38 Stash/STAMainWindowController.m
@@ -34,7 +34,13 @@ - (void)windowDidLoad
{
[super windowDidLoad];
- [[self findBarHeightConstraint] setConstant:0.0f];
+ NSRect findBarRect = [[self findBar] frame];
+ findBarRect.origin.y += findBarRect.size.height;
+ findBarRect.size.height = 0.0f;
+ [[self findBar] setFrame:findBarRect];
+ NSRect resultWebViewFrame = [[self resultWebView] frame];
+ resultWebViewFrame.size.height = findBarRect.origin.y - resultWebViewFrame.origin.y;
+ [[self resultWebView] setFrame:resultWebViewFrame];
[[[self resultWebView] preferences] setJavaEnabled:NO];
[[[self resultWebView] preferences] setJavaScriptEnabled:NO];
@@ -113,10 +119,16 @@ - (void)showFindUI
if (![self isFindUIShowing])
{
[self setFindUIShowing:YES];
+ CGRect findBarFrame = [[self findBar] frame];
+ findBarFrame.origin.y -= 25.0f;
+ findBarFrame.size.height = 25.0f;
+ NSRect resultWebViewFrame = [[self resultWebView] frame];
+ resultWebViewFrame.size.height = findBarFrame.origin.y - resultWebViewFrame.origin.y;
[NSAnimationContext runAnimationGroup:^ (NSAnimationContext *ctx)
{
[ctx setDuration:0.15];
- [[[self findBarHeightConstraint] animator] setConstant:25.0f];
+ [[[self findBar] animator] setFrame:findBarFrame];
+ [[[self resultWebView] animator] setFrame:resultWebViewFrame];
}
completionHandler:^(){}];
}
@@ -131,10 +143,16 @@ - (IBAction)hideSearchBar:(id)sender
[[self window] makeFirstResponder:[self searchField]];
}
[self setFindUIShowing:NO];
+ CGRect findBarFrame = [[self findBar] frame];
+ findBarFrame.origin.y += findBarFrame.size.height;
+ findBarFrame.size.height = 0.0f;
+ NSRect resultWebViewFrame = [[self resultWebView] frame];
+ resultWebViewFrame.size.height = findBarFrame.origin.y - resultWebViewFrame.origin.y;
[NSAnimationContext runAnimationGroup:^ (NSAnimationContext *ctx)
{
[ctx setDuration:0.15];
- [[[self findBarHeightConstraint] animator] setConstant:0.0f];
+ [[[self findBar] animator] setFrame:findBarFrame];
+ [[[self resultWebView] animator] setFrame:resultWebViewFrame];
}
completionHandler:^(){}];
}
@@ -310,6 +328,20 @@ - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEdito
return YES;
}
+- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex
+{
+ if (dividerIndex == 0)
+ {
+ return 229.0f;
+ }
+ return proposedMinimumPosition;
+}
+
+- (BOOL)splitView:(NSSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)view
+{
+ return view != [self searchColumn];
+}
+
@end
NSImage *NSImageFromSTAPlatform(STAPlatform p)
View
1,987 Stash/en.lproj/MainMenu.xib
44 additions, 1,943 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 2923114

Please sign in to comment.
Something went wrong with that request. Please try again.