Skip to content
Snippets Groups Projects
Commit 9354ec7f authored by George Nachman's avatar George Nachman
Browse files

Doesn't really work

parent 4501463c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -672,6 +672,7 @@ static NSString *kTmuxFontChanged = @"kTmuxFontChanged";
[antiIdleTimer release];
antiIdleTimer = nil;
newOutput = NO;
[view centerScrollView];
 
return YES;
}
Loading
Loading
@@ -718,6 +719,7 @@ static NSString *kTmuxFontChanged = @"kTmuxFontChanged";
[SCREEN resizeWidth:width height:height];
[SHELL setWidth:width height:height];
[TEXTVIEW clearHighlights];
[view centerScrollView];
[[tab_ realParentWindow] invalidateRestorableState];
}
 
Loading
Loading
Loading
Loading
@@ -1121,6 +1121,7 @@ static NSString* FormatRect(NSRect r) {
0,
theSize.width,
theSize.height)];
[[theSession view] centerScrollView];
if ([self isTmuxTab]) {
[[theSession view] setAutoresizesSubviews:NO];
}
Loading
Loading
@@ -2745,6 +2746,7 @@ static NSString* FormatRect(NSRect r) {
theSize.height)];
[[theSession view] setAutoresizesSubviews:NO];
[[theSession view] updateTitleFrame];
[[theSession view] centerScrollView];
}
}
 
Loading
Loading
Loading
Loading
@@ -4081,6 +4081,7 @@ NSString *kSessionsKVCKey = @"sessions";
[[self currentTab] numberOfSessionsDidChange];
[self setDimmingForSession:targetSession];
[sessionView updateDim];
[sessionView centerScrollView];
[[NSNotificationCenter defaultCenter] postNotificationName:@"iTermNumberOfSessionsDidChange" object: self userInfo: nil];
}
 
Loading
Loading
Loading
Loading
@@ -99,4 +99,6 @@
// rows and columns.
- (NSSize)compactFrame;
 
- (void)centerScrollView;
@end
Loading
Loading
@@ -536,6 +536,7 @@ static NSDate* lastResizeDate_;
[self updateTitleFrame];
}
[self setTitle:[session_ name]];
[self centerScrollView];
return YES;
}
 
Loading
Loading
@@ -585,23 +586,35 @@ static NSDate* lastResizeDate_;
 
- (void)updateTitleFrame
{
NSRect aRect = [self frame];
NSView *scrollView = (NSView *)[session_ SCROLLVIEW];
if (showTitle_) {
[title_ setFrame:NSMakeRect(0,
aRect.size.height - kTitleHeight,
aRect.size.width,
kTitleHeight)];
[scrollView setFrameOrigin:NSMakePoint(
0,
aRect.size.height - scrollView.frame.size.height - kTitleHeight)];
} else {
[scrollView setFrameOrigin:NSMakePoint(
0,
aRect.size.height - scrollView.frame.size.height)];
}
[findView_ setFrameOrigin:NSMakePoint(aRect.size.width - [[findView_ view] frame].size.width - 30,
aRect.size.height - [[findView_ view] frame].size.height)];
NSRect aRect = [self frame];
NSView *scrollView = (NSView *)[session_ SCROLLVIEW];
if (showTitle_) {
[title_ setFrame:NSMakeRect(0,
aRect.size.height - kTitleHeight,
aRect.size.width,
kTitleHeight)];
}
[self centerScrollView];
[findView_ setFrameOrigin:NSMakePoint(aRect.size.width - [[findView_ view] frame].size.width - 30,
aRect.size.height - [[findView_ view] frame].size.height)];
}
- (void)centerScrollView
{
int lineHeight = [[session_ TEXTVIEW] lineHeight];
int margins = VMARGIN * 2;
CGFloat titleHeight = showTitle_ ? title_.frame.size.height : 0;
NSRect rect = NSMakeRect(0,
0,
self.frame.size.width,
self.frame.size.height - titleHeight);
int rows = floor((rect.size.height - margins) / lineHeight);
CGFloat height = rows * lineHeight;
CGFloat offset = floor((rect.size.height - height) / 2);
[session_ SCROLLVIEW].frame = NSMakeRect(rect.origin.x,
rect.origin.y + offset,
rect.size.width,
rect.size.height - offset * 2);
}
 
- (void)setTitle:(NSString *)title
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment