Open GoogleCodeExporter opened 9 years ago
Index: PSMTabBarControl.h
===================================================================
--- PSMTabBarControl.h (revision 263)
+++ PSMTabBarControl.h (working copy)
@@ -212,6 +212,7 @@
//Tear-off tabs methods
- (NSImage *)tabView:(NSTabView *)aTabView imageForTabViewItem:(NSTabViewItem *)tabViewItem
offset:(NSSize *)offset styleMask:(unsigned int *)styleMask;
- (PSMTabBarControl *)tabView:(NSTabView *)aTabView newTabBarForDraggedTabViewItem:(NSTabViewItem
*)tabViewItem atPoint:(NSPoint)point;
+- (BOOL)tabView:(NSTabView *)aTabView
shouldSpeciallyTreatDraggingOfLastTabViewItem:(NSTabViewItem
*)tabViewItem;
- (void)tabView:(NSTabView *)aTabView closeWindowForLastTabViewItem:(NSTabViewItem *)tabViewItem;
//Overflow menu validation
Index: PSMTabDragAssistant.m
===================================================================
--- PSMTabDragAssistant.m (revision 263)
+++ PSMTabDragAssistant.m (working copy)
@@ -299,7 +299,9 @@
//set the window's alpha mask to zero if the last tab is being dragged
//don't fade out the old window if the delegate doesn't respond to the new tab bar method, just to
be safe
if ([[[self sourceTabBar] tabView] numberOfTabViewItems] == 1 && [self sourceTabBar] == control &&
- [[[self sourceTabBar] delegate]
respondsToSelector:@selector(tabView:newTabBarForDraggedTabViewItem:atPoint:)])
{
+ [[[self sourceTabBar] delegate]
respondsToSelector:@selector(tabView:newTabBarForDraggedTabViewItem:atPoint:)]
&&
+ (![[[self sourceTabBar] delegate]
respondsToSelector:@selector(tabView:shouldSpeciallyTreatDraggingOfLastTabViewIt
em:)] ||
+ [[[self sourceTabBar] delegate] tabView:[[self sourceTabBar] tabView]
shouldSpeciallyTreatDraggingOfLastTabViewItem:[[[[self sourceTabBar] tabView]
tabViewItems] lastObject]])) {
[[[self sourceTabBar] window] setAlphaValue:0.0];
if ([_sourceTabBar tearOffStyle] == PSMTabBarTearOffAlphaWindow) {
@@ -500,7 +502,9 @@
[[_draggedTab window] setFrameTopLeftPoint:aPoint];
[[_draggedTab window] orderFront:nil];
- if ([[[self sourceTabBar] tabView] numberOfTabViewItems] == 1) {
+ if ([[[self sourceTabBar] tabView] numberOfTabViewItems] == 1 &&
+ (![[[self sourceTabBar] delegate]
respondsToSelector:@selector(tabView:shouldSpeciallyTreatDraggingOfLastTabViewIt
em:)] ||
+ [[[self sourceTabBar] delegate] tabView:[[self sourceTabBar] tabView]
shouldSpeciallyTreatDraggingOfLastTabViewItem:[[[[self sourceTabBar] tabView]
tabViewItems] lastObject]])) {
[self draggingExitedTabBar:[self sourceTabBar]];
[[_draggedTab window] setAlphaValue:0.0];
}
Original comment by keithmal...@gmail.com
on 6 Aug 2008 at 12:08
This will make it behave like Safari: the source window will hide during drag
and the miniwindow will appear
308c308,309
< #warning fix me - what should we do when the last tab is dragged as a
miniwindow?
---
> [_draggedTab switchImages];
> _centersDragWindows = YES;
505c506,508
< [[_draggedTab window] setAlphaValue:0.0];
---
> if ([_sourceTabBar tearOffStyle] == PSMTabBarTearOffAlphaWindow) {
> [[_draggedTab window] setAlphaValue:0.0];
> }
Original comment by lruc...@mac.com
on 11 Jan 2011 at 12:59
Original issue reported on code.google.com by
keithmal...@gmail.com
on 6 Aug 2008 at 12:05