This repository was archived by the owner on Nov 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2003,7 +2003,6 @@ - (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabV
2003
2003
[self update ];
2004
2004
} else {
2005
2005
[_controller setSelectedCell: thisCell];
2006
- [self update ];
2007
2006
}
2008
2007
}
2009
2008
Original file line number Diff line number Diff line change @@ -92,18 +92,18 @@ - (void)setSelectedCell:(PSMTabBarCell *)cell {
92
92
}
93
93
94
94
[nextCell setState: NSOffState ];
95
- [nextCell setTabState: PSMTab_PositionMiddleMask ];
95
+ [nextCell setTabState: [nextCell tabState ] & ~(PSMTab_SelectedMask) ];
96
96
97
97
if (lastCell && lastCell != [_control lastVisibleTab ]) {
98
- [lastCell setTabState: ~ [lastCell tabState ] & PSMTab_RightIsSelectedMask];
98
+ [lastCell setTabState: [lastCell tabState ] & (~ PSMTab_RightIsSelectedMask) ];
99
99
}
100
100
101
101
if ((nextCell = [enumerator nextObject ])) {
102
- [nextCell setTabState: ~[lastCell tabState ] & PSMTab_LeftIsSelectedMask];
102
+ [nextCell setTabState: [nextCell tabState ] & (~ PSMTab_LeftIsSelectedMask) ];
103
103
}
104
104
105
105
[cell setState: NSOnState ];
106
- [cell setTabState: PSMTab_SelectedMask];
106
+ [cell setTabState: [cell tabState ] | PSMTab_SelectedMask];
107
107
108
108
if (![cell isInOverflowMenu ]) {
109
109
NSUInteger cellIndex = [cells indexOfObject: cell];
Original file line number Diff line number Diff line change @@ -778,7 +778,7 @@ - (void)distributePlaceholdersInTabBarControl:(PSMTabBarControl *)tabBarControl
778
778
// called upon first drag - must distribute placeholders
779
779
[self distributePlaceholdersInTabBarControl: tabBarControl];
780
780
781
- NSArray *cells = [tabBarControl cells ];
781
+ NSArray *cells = [[ tabBarControl cells ] copy ];
782
782
783
783
// replace dragged cell with a placeholder, and clean up surrounding cells
784
784
NSUInteger cellIndex = [cells indexOfObject: cell];
@@ -789,9 +789,14 @@ - (void)distributePlaceholdersInTabBarControl:(PSMTabBarControl *)tabBarControl
789
789
[tabBarControl removeCellAtIndex: (cellIndex + 1 )];
790
790
[tabBarControl removeCellAtIndex: (cellIndex - 1 )];
791
791
792
+ // if cell was selected cell, update selection direction markers of surrounding cells
792
793
if ((NSInteger )cellIndex - 2 >= 0 ) {
793
794
pc = [cells objectAtIndex: cellIndex - 2 ];
794
- [pc setTabState: ~[pc tabState ] & PSMTab_RightIsSelectedMask];
795
+ [pc setTabState: [pc tabState ] & (~PSMTab_RightIsSelectedMask)];
796
+ }
797
+ if ((NSInteger )cellIndex + 2 < cells.count ) {
798
+ pc = [cells objectAtIndex: cellIndex + 2 ];
799
+ [pc setTabState: [pc tabState ] & (~PSMTab_LeftIsSelectedMask)];
795
800
}
796
801
}
797
802
}
You can’t perform that action at this time.
0 commit comments