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

Make cmd [ and ] work when maximized

parent c34ddccd
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -184,6 +184,7 @@ static const int MIN_SESSION_COLUMNS = 2;
- (NSDictionary*)arrangement;
 
- (BOOL)hasMaximizedPane;
- (void)maximizeWithoutMakingKey;
- (void)maximize;
- (void)unmaximize;
 
Loading
Loading
Loading
Loading
@@ -370,17 +370,32 @@ static const BOOL USE_THIN_SPLITTERS = YES;
return nil;
}
 
- (void)previousSession
- (SessionView *)_savedViewWithId:(int)i
{
if (isMaximized_) {
return;
for (NSNumber *k in idMap_) {
SessionView *cur = [idMap_ objectForKey:k];
if ([cur viewId] == [[viewOrder_ objectAtIndex:i] intValue]) {
return cur;
}
}
return nil;
}
- (void)previousSession
{
--currentViewIndex_;
if (currentViewIndex_ < 0) {
currentViewIndex_ = [viewOrder_ count] - 1;
}
SessionView* sv = [self _recursiveSessionViewWithId:[[viewOrder_ objectAtIndex:currentViewIndex_] intValue]
atNode:root_];
SessionView *sv;
if (isMaximized_) {
sv = [self _savedViewWithId:currentViewIndex_];
[root_ replaceSubview:[[root_ subviews] objectAtIndex:0]
with:sv];
} else {
sv = [self _recursiveSessionViewWithId:[[viewOrder_ objectAtIndex:currentViewIndex_] intValue]
atNode:root_];
}
assert(sv);
if (sv) {
[self setActiveSessionPreservingViewOrder:[sv session]];
Loading
Loading
@@ -389,15 +404,19 @@ static const BOOL USE_THIN_SPLITTERS = YES;
 
- (void)nextSession
{
if (isMaximized_) {
return;
}
++currentViewIndex_;
if (currentViewIndex_ >= [viewOrder_ count]) {
currentViewIndex_ = 0;
}
SessionView* sv = [self _recursiveSessionViewWithId:[[viewOrder_ objectAtIndex:currentViewIndex_] intValue]
atNode:root_];
SessionView *sv;
if (isMaximized_) {
sv = [self _savedViewWithId:currentViewIndex_];
[root_ replaceSubview:[[root_ subviews] objectAtIndex:0]
with:sv];
} else {
sv = [self _recursiveSessionViewWithId:[[viewOrder_ objectAtIndex:currentViewIndex_] intValue]
atNode:root_];
}
assert(sv);
if (sv) {
[self setActiveSessionPreservingViewOrder:[sv session]];
Loading
Loading
@@ -1687,6 +1706,7 @@ static NSString* FormatRect(NSRect r) {
if (idMap) {
[result setObject:[NSNumber numberWithInt:[idMap count]]
forKey:TAB_ARRANGEMENT_ID];
[sessionView saveFrameSize];
[idMap setObject:sessionView forKey:[NSNumber numberWithInt:[idMap count]]];
}
}
Loading
Loading
@@ -1763,7 +1783,9 @@ static NSString* FormatRect(NSRect r) {
return splitter;
} else {
if (theMap) {
return [[theMap objectForKey:[arrangement objectForKey:TAB_ARRANGEMENT_ID]] retain];
SessionView *sv = [[theMap objectForKey:[arrangement objectForKey:TAB_ARRANGEMENT_ID]] retain];
[sv restoreFrameSize];
return sv;
} else {
return [[SessionView alloc] initWithFrame:[PTYTab dictToFrame:[arrangement objectForKey:TAB_ARRANGEMENT_SESSIONVIEW_FRAME]]];
}
Loading
Loading
Loading
Loading
@@ -46,6 +46,9 @@
 
// Unique per-process id of view, used for ordering them in PTYTab.
int viewId_;
// Saved size for unmaximizing.
NSSize savedSize_;
}
 
+ (NSDate*)lastResizeDate;
Loading
Loading
@@ -62,5 +65,7 @@
- (void)setBackgroundDimmed:(BOOL)backgroundDimmed;
- (void)updateDim;
- (BOOL)backgroundDimmed;
- (void)saveFrameSize;
- (void)restoreFrameSize;
 
@end
Loading
Loading
@@ -271,4 +271,14 @@ static NSDate* lastResizeDate_;
lastResizeDate_ = [[NSDate date] retain];
}
 
- (void)saveFrameSize
{
savedSize_ = [self frame].size;
}
- (void)restoreFrameSize
{
[self setFrameSize:savedSize_];
}
@end
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