mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
Let ProjectLayoutView setup height of file browser header
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user