This repository was archived by the owner on Nov 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1998,15 +1998,22 @@ - (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabV
1998
1998
id tempDelegate = [aTabView delegate ];
1999
1999
[aTabView setDelegate: nil ];
2000
2000
2001
+ PSMTabBarCell *lastVisibleCell = self.lastVisibleTab ;
2002
+ NSUInteger *lastVisibleCellIndex = [self .cells indexOfObject: lastVisibleCell];
2003
+
2001
2004
// move it all around first
2002
2005
[tabViewItem retain ];
2003
2006
[thisCell retain ];
2007
+
2004
2008
[aTabView removeTabViewItem: tabViewItem];
2005
- [aTabView insertTabViewItem: tabViewItem atIndex: 0 ];
2009
+ [aTabView insertTabViewItem: tabViewItem atIndex: lastVisibleCellIndex];
2010
+
2006
2011
[self removeCellAtIndex: (NSUInteger )tabIndex];
2007
- [self insertCell: thisCell atIndex: 0 ];
2008
- [thisCell setIsInOverflowMenu: NO ]; // very important else we get a fun recursive loop going
2009
- [[_cells objectAtIndex: [_cells count ] - 1 ] setIsInOverflowMenu: YES ]; // these 2 lines are pretty uncool and this logic needs to be updated
2012
+ [self insertCell: thisCell atIndex: lastVisibleCellIndex];
2013
+
2014
+ [thisCell setIsInOverflowMenu: NO ]; // very important else we get a fun recursive loop going
2015
+ [lastVisibleCell setIsInOverflowMenu: YES ]; // now the former lastVisible Cell goes into the overflow popup
2016
+
2010
2017
[thisCell release ];
2011
2018
[tabViewItem release ];
2012
2019
You can’t perform that action at this time.
0 commit comments