You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed unusual behaviour when the tabView:shouldAllowTabViewItem:toLeaveTabBar: delegate method return NO. My goal is to allow tabs to be dragged within the current tab bar (to allow them to be re-ordered), but to disallow tear-off or dropping onto other tab bars.
I have modified DemoWindowController.m to include the following delegate method:
With the above change, I am able to successfully drag tabs within the tab bar, but if I attempt to drop outside of the tab bar, the ordering of the tabs seems to get out of sync with the actual tab view. Similarly, the highlighting of the tabs doesn't correspond with the currently selected tab view item in the tab view.
I hope this makes sense. Please feel free to contact me if you require any further information.
The text was updated successfully, but these errors were encountered:
I also saw this erroneous behavior. If you look at the comments in performDragOperation you'll see why it doesn't work: When you try to put the dragged cell back into the original tab bar at the same index you took it from, you will fail to account for the placeholders that are inserted when dragging begins. Rather than duplicating the code that removes the placeholders, I fixed it by modifying draggedImageEndedAt:operation: so that instead of simply putting the dragged cell back at the index from which it was taken, it calls performDragOperation. Here's the modified code:
// put cell back
// 8/27/13 - You can't just put this back at the same location because there are
// placeholders inserted during dragging. See comments in performDragOperation.
// AVOID:
// [[self sourceTabBar] insertCell:[self draggedCell] atIndex:[self draggedCellIndex]];
[self performDragOperation];
It's possible I'm not accounting for all conditions, but this seems to be working.
Hi,
I have noticed unusual behaviour when the tabView:shouldAllowTabViewItem:toLeaveTabBar: delegate method return NO. My goal is to allow tabs to be dragged within the current tab bar (to allow them to be re-ordered), but to disallow tear-off or dropping onto other tab bars.
I have modified DemoWindowController.m to include the following delegate method:
With the above change, I am able to successfully drag tabs within the tab bar, but if I attempt to drop outside of the tab bar, the ordering of the tabs seems to get out of sync with the actual tab view. Similarly, the highlighting of the tabs doesn't correspond with the currently selected tab view item in the tab view.
I hope this makes sense. Please feel free to contact me if you require any further information.
The text was updated successfully, but these errors were encountered: