diff --git a/Frameworks/DocumentWindow/src/ProjectLayoutView.mm b/Frameworks/DocumentWindow/src/ProjectLayoutView.mm index 70288f0b..a1617ec4 100644 --- a/Frameworks/DocumentWindow/src/ProjectLayoutView.mm +++ b/Frameworks/DocumentWindow/src/ProjectLayoutView.mm @@ -216,6 +216,10 @@ NSString* const kUserDefaultsHTMLOutputSizeKey = @"htmlOutputSize"; { CONSTRAINT(@"H:[fileBrowserTopDivider][documentView]", 0); } + + // Setup file browser’s header to match height of tab bar view + if(_fileBrowserHeaderView) + [_myConstraints addObject:[NSLayoutConstraint constraintWithItem:_fileBrowserHeaderView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_tabBarView attribute:NSLayoutAttributeHeight multiplier:1 constant:-2]]; } else { diff --git a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm index 0443e601..e63baf50 100644 --- a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm +++ b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm @@ -64,34 +64,12 @@ static NSPopUpButton* OakCreateFolderPopUpButton () [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(-3)-[folder(>=75)]-(3)-[divider]-(2)-[back(==22)]-(2)-[forward(==back)]-(3)-|" options:0 metrics:nil views:views]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[folder(==divider,==back,==forward)]|" options:0 metrics:nil views:views]]; - - [self userDefaultsDidChange:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDefaultsDidChange:) name:NSUserDefaultsDidChangeNotification object:[NSUserDefaults standardUserDefaults]]; } return self; } -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)userDefaultsDidChange:(NSNotification*)aNotification -{ - self.matchTabBarHeight = [[NSUserDefaults standardUserDefaults] boolForKey:kUserDefaultsTabsAboveDocumentKey]; -} - -- (void)setMatchTabBarHeight:(BOOL)flag -{ - if(_matchTabBarHeight != flag) - { - _matchTabBarHeight = flag; - [self invalidateIntrinsicContentSize]; - } -} - - (NSSize)intrinsicContentSize { - return NSMakeSize(NSViewNoInstrinsicMetric, self.matchTabBarHeight ? 21 : 24); + return NSMakeSize(NSViewNoInstrinsicMetric, 24); } @end