Changeset 2039
- Timestamp:
- 10/21/04 14:14:19 (4 years ago)
- Files:
-
- branches/overhaul/AICustomTabDragWindow.h (modified) (1 diff)
- branches/overhaul/AICustomTabDragWindow.m (modified) (1 diff)
- trunk/AICustomTabCell.h (modified) (2 diffs)
- trunk/AICustomTabCell.m (modified) (16 diffs)
- trunk/AICustomTabDragging.h (modified) (1 diff)
- trunk/AICustomTabDragging.m (modified) (2 diffs)
- trunk/AICustomTabsView.h (modified) (1 diff)
- trunk/AICustomTabsView.m (modified) (14 diffs)
- trunk/ESFloater.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/overhaul/AICustomTabDragWindow.h
r1823 r2039 7 7 // 8 8 9 @class ESFloater; 10 @class AICustomTabsView; 11 @class AICustomTabCell; 9 @class ESFloater, AICustomTabsView, AICustomTabCell; 12 10 13 11 @interface AICustomTabDragWindow : NSObject { branches/overhaul/AICustomTabDragWindow.m
r1823 r2039 34 34 floaterTabImage = [[self dragTabImageForTabCell:inTabCell inCustomTabsView:inTabView] retain]; 35 35 floaterWindowImage = [[self dragWindowImageForWindow:[inTabView window] customTabsView:inTabView tabCell:inTabCell] retain]; 36 useFancyAnimations = ( NSAppKitVersionNumber >= 700. && floaterWindowImage);36 useFancyAnimations = ( floaterWindowImage ? YES : NO ); 37 37 38 38 if(useFancyAnimations){ 39 39 //Create a floating window for our tab 40 dragTabFloater = [ESFloater floaterWithImage:floaterTabImage styleMask:NSBorderlessWindowMask title:nil];41 [dragTabFloater setMaxOpacity: ( transparent ? 0.75 : 1. )];40 dragTabFloater = [ESFloater floaterWithImage:floaterTabImage styleMask:NSBorderlessWindowMask]; 41 [dragTabFloater setMaxOpacity:1.0]; 42 42 43 43 //Create a floating window for the stand-alone window our tab would produce 44 dragWindowFloater = [ESFloater floaterWithImage:floaterWindowImage styleMask: [[inTabView window] styleMask] title:[[inTabView window] title]];45 [dragWindowFloater setMaxOpacity:( transparent ? 0.75 : 1.)];44 dragWindowFloater = [ESFloater floaterWithImage:floaterWindowImage styleMask:NSTitledWindowMask]; 45 [dragWindowFloater setMaxOpacity:(transparent ? 0.75 : 1.00)]; 46 46 } 47 47 trunk/AICustomTabCell.h
r1720 r2039 14 14 \------------------------------------------------------------------------------------------------------ */ 15 15 16 @ interface NSObject (AICustomTabViewItem)16 @protocol AICustomTabViewItem 17 17 - (NSString *)label; 18 18 - (NSImage *)icon; 19 - (BOOL) isEnabled;20 19 @end 21 20 21 @class AICustomTabsView; 22 22 23 @interface AICustomTabCell : NSCell { 23 BOOL wasEnabled; 24 BOOL selected; 25 BOOL highlighted; 26 BOOL allowsInactiveTabClosing; 24 BOOL selected; 25 BOOL highlighted; 26 BOOL allowsInactiveTabClosing; 27 27 28 BOOL trackingClose;29 BOOL hoveringClose;28 BOOL trackingClose; 29 BOOL hoveringClose; 30 30 31 NSTrackingRectTag trackingTag; 32 NSDictionary *userData; 33 NSTrackingRectTag closeTrackingTag; 34 NSDictionary *closeUserData; 35 NSToolTipTag toolTipTag; 31 NSTrackingRectTag trackingTag; 32 NSTrackingRectTag closeTrackingTag; 33 NSTrackingRectTag toolTipTag; 36 34 37 NSAttributedString *attributedLabel; 38 NSTabViewItem *tabViewItem; 39 NSRect frame; 35 NSAttributedString *attributedLabel; 36 NSTabViewItem<AICustomTabViewItem> *tabViewItem; 37 NSRect frame; 38 39 AICustomTabsView *view; 40 40 } 41 41 42 + (id)customTabForTabViewItem:(NSTabViewItem *)inTabViewItem;42 + (id)customTabForTabViewItem:(NSTabViewItem<AICustomTabViewItem> *)inTabViewItem customTabsView:(AICustomTabsView *)inView; 43 43 - (void)setAllowsInactiveTabClosing:(BOOL)inValue; 44 44 - (BOOL)allowsInactiveTabClosing; 45 45 - (void)setSelected:(BOOL)inSelected; 46 46 - (BOOL)isSelected; 47 - (void)setHighlighted:(BOOL)inHighlighted; 47 - (void)setHoveringClose:(BOOL)hovering; 48 - (void)setHighlighted:(BOOL)inHighlight; 48 49 - (BOOL)isHighlighted; 49 50 - (void)setFrame:(NSRect)inFrame; … … 54 55 - (void)drawWithFrame:(NSRect)rect inView:(NSView *)controlView; 55 56 - (void)drawWithFrame:(NSRect)rect inView:(NSView *)controlView ignoreSelection:(BOOL)ignoreSelection; 56 - (void)addTrackingRects InView:(NSView *)view withFrame:(NSRect)trackRect cursorLocation:(NSPoint)cursorLocation;57 - (void)removeTrackingRects FromView:(NSView *)view;57 - (void)addTrackingRectsWithFrame:(NSRect)trackRect cursorLocation:(NSPoint)cursorLocation; 58 - (void)removeTrackingRects; 58 59 - (void)mouseEntered:(NSEvent *)theEvent; 59 60 - (void)mouseExited:(NSEvent *)theEvent; trunk/AICustomTabCell.m
r1823 r2039 27 27 static NSImage *tabCloseFrontPressed = nil; 28 28 static NSImage *tabCloseFrontRollover = nil; 29 static NSSize leftCapSize; 30 static NSSize rightCapSize; 29 31 30 32 #define TAB_CLOSE_LEFTPAD 2 //Padding left of close button 31 33 #define TAB_CLOSE_RIGHTPAD 3 //Padding right of close button 32 34 33 #define TAB_CLOSE_Y_OFFSET 1//Vertical offset of close button from center35 #define TAB_CLOSE_Y_OFFSET 2 //Vertical offset of close button from center 34 36 35 37 #define TAB_RIGHT_PAD 5 //Tab right edge padding … … 40 42 41 43 @interface AICustomTabCell (PRIVATE) 42 - (id)initForTabViewItem:(NSTabViewItem *)inTabViewItem;44 - (id)initForTabViewItem:(NSTabViewItem<AICustomTabViewItem> *)inTabViewItem customTabsView:(AICustomTabsView *)inView; 43 45 - (NSRect)_closeButtonRect; 44 46 @end … … 47 49 48 50 //Create a new custom tab 49 + (id)customTabForTabViewItem:(NSTabViewItem *)inTabViewItem50 { 51 return([[[self alloc] initForTabViewItem:inTabViewItem ] autorelease]);51 + (id)customTabForTabViewItem:(NSTabViewItem<AICustomTabViewItem> *)inTabViewItem customTabsView:(AICustomTabsView *)inView 52 { 53 return([[[self alloc] initForTabViewItem:inTabViewItem customTabsView:inView] autorelease]); 52 54 } 53 55 54 56 //init 55 - (id)initForTabViewItem:(NSTabViewItem *)inTabViewItem57 - (id)initForTabViewItem:(NSTabViewItem<AICustomTabViewItem> *)inTabViewItem customTabsView:(AICustomTabsView *)inView 56 58 { 57 59 static BOOL haveLoadedImages = NO; … … 64 66 tabFrontMiddle = [[NSImage imageNamed:@"aquaTabMiddle"] retain]; 65 67 tabFrontRight = [[NSImage imageNamed:@"aquaTabRight"] retain]; 66 67 // NSControlTint tint = [NSColor currentControlTintSupportingJag]; 68 68 69 tabCloseFront = [[NSImage imageNamed:@"aquaTabClose"] retain]; 69 70 tabCloseBack = [[NSImage imageNamed:@"aquaTabCloseBack"] retain]; … … 71 72 tabCloseFrontRollover = [[NSImage imageNamed:@"aquaTabCloseRollover"] retain]; 72 73 74 leftCapSize = [tabFrontLeft size]; 75 rightCapSize = [tabFrontRight size]; 76 73 77 haveLoadedImages = YES; 74 78 } 75 79 76 80 tabViewItem = [inTabViewItem retain]; 81 view = inView; 77 82 allowsInactiveTabClosing = NO; 78 wasEnabled = YES;79 83 trackingClose = NO; 80 84 hoveringClose = NO; … … 99 103 - (NSSize)size 100 104 { 101 int width = [tabFrontLeft size].width + [[self attributedLabel] size].width + [tabFrontRight size].width +105 int width = leftCapSize.width + [[self attributedLabel] size].width + rightCapSize.width + 102 106 (TAB_CLOSE_LEFTPAD + [[tabViewItem icon] size].width + TAB_CLOSE_RIGHTPAD) + TAB_RIGHT_PAD; 103 107 104 return( NSMakeSize((width > TAB_MIN_WIDTH ? width : TAB_MIN_WIDTH), [tabFrontLeft size].height) );108 return( NSMakeSize((width > TAB_MIN_WIDTH ? width : TAB_MIN_WIDTH), leftCapSize.height) ); 105 109 } 106 110 … … 134 138 NSSize iconSize = [[tabViewItem icon] size]; 135 139 NSSize closeSize = [tabCloseFront size]; 136 int centeredYPos = frame.origin.y + (frame.size.height - [tabCloseFront size].height) / 2.0; 137 return(NSMakeRect(frame.origin.x + [tabFrontLeft size].width + TAB_CLOSE_LEFTPAD + ((iconSize.width - closeSize.width) / 2.0), 138 centeredYPos + TAB_CLOSE_Y_OFFSET + 1, 140 int centerY = (frame.size.height - [tabCloseFront size].height) / 2.0; 141 142 return(NSMakeRect(frame.origin.x + leftCapSize.width + TAB_CLOSE_LEFTPAD + ((iconSize.width - closeSize.width) / 2.0), 143 frame.origin.y + centerY + TAB_CLOSE_Y_OFFSET + 1, 139 144 [tabCloseFront size].width, 140 145 [tabCloseFront size].height)); 146 } 147 148 //Frame of our tab icon 149 - (NSRect)_tabIconRect 150 { 151 NSSize imageSize = [[tabViewItem icon] size]; 152 int centerY = (frame.size.height - imageSize.height) / 2.0; 153 154 return(NSMakeRect(frame.origin.x + leftCapSize.width + TAB_CLOSE_LEFTPAD, 155 frame.origin.y + centerY + TAB_CLOSE_Y_OFFSET, 156 imageSize.width, 157 imageSize.height)); 141 158 } 142 159 … … 163 180 164 181 //When a tab is hovered it should be highlighted. Highlighted tabs draw differently. 165 - (void)setHighlighted:(BOOL)inHighlighted 166 { 167 highlighted = inHighlighted; 182 - (void)setHighlighted:(BOOL)inHighlight 183 { 184 if(highlighted != inHighlight){ 185 highlighted = inHighlight; 186 [view setNeedsDisplayInRect:[self frame]]; 187 } 168 188 } 169 189 - (BOOL)isHighlighted{ 170 190 return(highlighted); 191 } 192 193 //Set whether the close button is currently hovered 194 - (void)setHoveringClose:(BOOL)hovering 195 { 196 if(hoveringClose != hovering){ 197 hoveringClose = hovering; 198 [view setNeedsDisplayInRect:NSUnionRect([self _tabIconRect],[self _closeButtonRect])]; 199 } 171 200 } 172 201 … … 192 221 - (void)drawWithFrame:(NSRect)rect inView:(NSView *)controlView ignoreSelection:(BOOL)ignoreSelection 193 222 { 194 int leftCapWidth, rightCapWidth,middleSourceWidth, middleRightEdge, middleLeftEdge;223 int middleSourceWidth, middleRightEdge, middleLeftEdge; 195 224 NSRect sourceRect, destRect; 196 225 NSSize labelSize; … … 199 228 //Pre-calc some dimensions 200 229 labelSize = [tabViewItem sizeOfLabel:NO]; 201 leftCapWidth = [tabFrontLeft size].width;202 rightCapWidth = [tabFrontRight size].width;203 230 middleSourceWidth = [tabFrontMiddle size].width; 204 middleRightEdge = (rect.origin.x + rect.size.width - rightCap Width);205 middleLeftEdge = (rect.origin.x + leftCap Width);231 middleRightEdge = (rect.origin.x + rect.size.width - rightCapSize.width); 232 middleLeftEdge = (rect.origin.x + leftCapSize.width); 206 233 207 234 //Background … … 230 257 } 231 258 232 //Offset for icon233 rect.origin.x += leftCapWidth;234 rect.size.width -= leftCapWidth + rightCapWidth;235 236 259 //We'll display our close icon if the user is hovering. Otherwise, we display the tab specified icon 237 260 NSImage *leftIcon = [tabViewItem icon]; … … 245 268 246 269 }else{ 247 destPoint = NSMakePoint(frame.origin.x + [tabFrontLeft size].width + TAB_CLOSE_LEFTPAD, 248 ((frame.size.height - [leftIcon size].height) / 2.0) + TAB_CLOSE_Y_OFFSET); 270 destPoint = [self _tabIconRect].origin; 249 271 } 250 251 // Draw at whole pixel points only. 252 destPoint.y = ceilf( destPoint.y ); 253 destPoint.x = ceilf( destPoint.x ); 254 255 [leftIcon compositeToPoint:destPoint operation:NSCompositeSourceOver fraction:( [tabViewItem isEnabled] ? 1. : 0.5 )]; 272 [leftIcon compositeToPoint:destPoint operation:NSCompositeSourceOver]; 256 273 257 274 //Move over for label drawing. We always move based on the tab icon and not on the close button. This prevents 258 275 //tab text from jumping when hovered if the tab icons are a different size from the close button 259 NSSize leftIconSize = [[tabViewItem icon] size]; 260 rect.origin.x += TAB_CLOSE_LEFTPAD + leftIconSize.width + TAB_CLOSE_RIGHTPAD; 261 rect.size.width -= TAB_CLOSE_LEFTPAD + leftIconSize.width + TAB_CLOSE_RIGHTPAD + TAB_RIGHT_PAD; 262 276 int offsetX = leftCapSize.width + TAB_CLOSE_LEFTPAD + [self _tabIconRect].size.width + TAB_CLOSE_RIGHTPAD; 277 rect.origin.x += offsetX; 278 rect.size.width -= offsetX + TAB_RIGHT_PAD; 263 279 264 280 //Draw our label … … 276 292 NSString *label = [tabViewItem label]; 277 293 278 if(![label isEqualToString:[attributedLabel string]] || wasEnabled != [tabViewItem isEnabled] ){ 279 wasEnabled = [tabViewItem isEnabled]; 294 if(![label isEqualToString:[attributedLabel string]]){ 280 295 //Paragraph Style (Turn off clipping by word) 281 296 NSMutableParagraphStyle *paragraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; 282 297 [paragraphStyle setAlignment:NSCenterTextAlignment]; 283 298 [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; 284 299 285 300 //Update the attributed string 286 301 [attributedLabel release]; 287 attributedLabel = [[NSAttributedString alloc] initWithString: labelattributes:302 attributedLabel = [[NSAttributedString alloc] initWithString:[tabViewItem label] attributes: 288 303 [NSDictionary dictionaryWithObjectsAndKeys: 289 ( wasEnabled ? [NSColor controlTextColor] : [[NSColor controlTextColor] colorWithAlphaComponent:0.5] ), NSForegroundColorAttributeName,304 [NSColor controlTextColor], NSForegroundColorAttributeName, 290 305 [NSFont systemFontOfSize:11], NSFontAttributeName, 291 306 paragraphStyle, NSParagraphStyleAttributeName, … … 300 315 #pragma mark Cursor tracking 301 316 //Install tracking rects for our tab and its close button 302 - (void)addTrackingRectsInView:(NSView *)view withFrame:(NSRect)trackRect cursorLocation:(NSPoint)cursorLocation 303 { 304 userData = [[NSDictionary dictionaryWithObjectsAndKeys:view, @"view", nil] retain]; //We have to retain and release the userData ourself 317 - (void)addTrackingRectsWithFrame:(NSRect)trackRect cursorLocation:(NSPoint)cursorLocation 318 { 305 319 trackingTag = [view addTrackingRect:trackRect 306 320 owner:self 307 userData: userData321 userData:nil 308 322 assumeInside:NSPointInRect(cursorLocation, trackRect)]; 309 highlighted = NSPointInRect(cursorLocation, trackRect); 310 311 closeUserData = [[NSDictionary dictionaryWithObjectsAndKeys:view, @"view", [NSNumber numberWithBool:YES], @"close", nil] retain]; //We have to retain and release the userData ourself 323 [self setHighlighted:NSPointInRect(cursorLocation, trackRect)]; 324 312 325 closeTrackingTag = [view addTrackingRect:[self _closeButtonRect] 313 326 owner:self 314 userData: closeUserData327 userData:nil 315 328 assumeInside:NSPointInRect(cursorLocation, [self _closeButtonRect])]; 316 hoveringClose = NSPointInRect(cursorLocation, [self _closeButtonRect]);317 329 [self setHoveringClose:NSPointInRect(cursorLocation, [self _closeButtonRect])]; 330 318 331 toolTipTag = [view addToolTipRect:trackRect owner:view userData:NULL]; 319 332 } 320 333 321 334 //Remove our tracking rects 322 - (void)removeTrackingRects FromView:(NSView *)view335 - (void)removeTrackingRects 323 336 { 324 337 [view removeTrackingRect:trackingTag]; trackingTag = 0; 325 [userData autorelease]; userData = nil;326 327 338 [view removeTrackingRect:closeTrackingTag]; closeTrackingTag = 0; 328 [closeUserData autorelease]; closeUserData = nil;329 330 339 [view removeToolTip:toolTipTag]; toolTipTag = 0; 331 340 } … … 334 343 - (void)mouseEntered:(NSEvent *)theEvent 335 344 { 336 NSDictionary *eventData = [theEvent userData];337 NSView *view = [eventData objectForKey:@"view"];338 339 345 //Scrubs the tab if control is down. 340 //if(([theEvent modifierFlags] & NSAlternateKeyMask) && !selected){341 //[[tabViewItem tabView] selectTabViewItem:tabViewItem];342 //}343 344 //Set ourself (or our close button) has hovered345 if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ) ) && [[eventData objectForKey:@"close"] boolValue]){346 hoveringClose = YES; 347 [view setNeedsDisplayInRect:[self frame]];346 if(([theEvent modifierFlags] & NSAlternateKeyMask) && !selected){ 347 [[tabViewItem tabView] selectTabViewItem:tabViewItem]; 348 } 349 350 //Set ourself (or our close button) as hovered 351 if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )) && 352 ([theEvent trackingNumber] == closeTrackingTag)){ 353 [self setHoveringClose:YES]; 348 354 }else{ 349 highlighted = YES; 350 [view setNeedsDisplayInRect:[self frame]]; 351 } 352 } 353 354 //Mouse left one of our tabs 355 [self setHighlighted:YES]; 356 } 357 } 358 359 //Mouse left one of our tabs - Set ourself (or our close button) as not hovered 355 360 - (void)mouseExited:(NSEvent *)theEvent 356 361 { 357 NSDictionary *eventData = [theEvent userData]; 358 NSView *view = [eventData objectForKey:@"view"]; 359 360 //Set ourself (or our close button) has not hovered 361 if([[eventData objectForKey:@"close"] boolValue]){ 362 hoveringClose = NO; 363 [view setNeedsDisplayInRect:[self frame]]; 362 if([theEvent trackingNumber] == closeTrackingTag){ 363 [self setHoveringClose:NO]; 364 364 }else{ 365 highlighted = NO; 366 [view setNeedsDisplayInRect:[self frame]]; 365 [self setHighlighted:NO]; 367 366 } 368 367 } … … 374 373 - (BOOL)willTrackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView 375 374 { 376 if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ) ) &&375 if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )) && 377 376 (SHOW_CLOSE_BUTTON_FOR_SINGLE_TAB || [[tabViewItem tabView] numberOfTabViewItems] != 1) && 378 377 NSPointInRect([controlView convertPoint:[theEvent locationInWindow] fromView:nil], [self _closeButtonRect])){ trunk/AICustomTabDragging.h
r1660 r2039 12 12 #define AICustomTabDragDidComplete @"AICustomTabDragDidComplete" 13 13 14 @class AICustomTab DragWindow, AICustomTabsView, AICustomTabCell;14 @class AICustomTabCell,AICustomTabDragWindow, AICustomTabsView; 15 15 16 16 @interface AICustomTabDragging : NSObject { trunk/AICustomTabDragging.m
r1823 r2039 126 126 if(sourceWindowWillHide){ 127 127 [[sourceTabBar window] setAlphaValue:0.0]; 128 [[[sourceTabBar window] drawers] makeObjectsPerformSelector:@selector(close)];129 128 } 130 129 … … 202 201 - (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation 203 202 { 204 if(operation == 0){ //when dropped on the screen203 if(operation == NSDragOperationNone){ //when dropped on the screen 205 204 //Sneaky Bug Fix --- 206 205 //If a drag is done very quickly, the system will fail to send our tab bar a draggingExited event, even though trunk/AICustomTabsView.h
r1823 r2039 17 17 #define TAB_CELL_IDENTIFIER @"Tab Cell Identifier" 18 18 19 @class AICustomTabCell; 20 @class AICustomTabsView; 19 @class AICustomTabCell, AICustomTabsView; 21 20 22 21 @interface NSObject (AICustomTabsViewDelegate) trunk/AICustomTabsView.m
r1823 r2039 154 154 allowsTabRearranging = inValue; 155 155 } 156 157 156 - (BOOL)allowsTabRearranging 158 157 { … … 229 228 //Account for shifting 230 229 if(currentIndex < newIndex) newIndex--; 231 230 232 231 //Move via a remove and add :( 233 232 [tabCell retain]; … … 235 234 [tabCellArray insertObject:tabCell atIndex:newIndex]; 236 235 [tabCell release]; 237 236 238 237 //Move the tab 239 238 ignoreTabNumberChange = YES; … … 356 355 357 356 //Create a new tab cell 358 tabCell = [AICustomTabCell customTabForTabViewItem:tabViewItem ];357 tabCell = [AICustomTabCell customTabForTabViewItem:tabViewItem customTabsView:self]; 359 358 [tabCell setSelected:(tabViewItem == [tabView selectedTabViewItem])]; 360 359 [tabCell setAllowsInactiveTabClosing:allowsInactiveTabClosing]; … … 434 433 int totalTabWidth; 435 434 int reducedWidth = 0; 436 floatreduceThreshold = 1000000;435 int reduceThreshold = 1000000; 437 436 438 437 //Get the total tab width … … 535 534 tabDivider = [[NSImage imageNamed:@"aquaTabDivider"] retain]; 536 535 tabBackground = [[NSImage imageNamed:@"aquaTabBackground"] retain]; 537 538 536 haveLoadedImages = YES; 539 537 } … … 625 623 AICustomTabCell *tabCell = [self tabAtPoint:clickLocation]; 626 624 627 [tabView selectTabViewItem:[tabCell tabViewItem]];628 629 625 //Pass this on to our delegate 630 626 if(tabCell && [delegate respondsToSelector:@selector(customTabView:menuForTabViewItem:)]){ … … 633 629 return(nil); 634 630 } 631 635 632 636 633 //Tooltip ------------------------------------------------------------------------------------------------------ … … 640 637 NSPoint location = [self convertPoint:point fromView:nil]; 641 638 AICustomTabCell *tabCell = [self tabAtPoint:location]; 642 643 //Pass this on to our delegate639 640 //Pass this on to our delegate 644 641 if(tabCell && [delegate respondsToSelector:@selector(customTabView:toolTipForTabViewItem:)]){ 645 642 return([delegate customTabView:self toolTipForTabViewItem:[tabCell tabViewItem]]); … … 661 658 if(tabCell = [self tabAtPoint:lastClickLocation]){ 662 659 if(![tabCell willTrackMouse:theEvent inRect:[tabCell frame] ofView:self]){ 663 // if(! ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )){ //Allow background dragging660 // if(!( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )){ //Allow background dragging 664 661 [tabView selectTabViewItem:[tabCell tabViewItem]]; 665 662 // } … … 704 701 } 705 702 706 //Dragging -------------------------------------------------------------------------------------------------------------707 #pragma mark Dragging708 703 //Return the drag types we accept 709 704 - (NSArray *)acceptableDragTypes … … 824 819 [[AICustomTabDragging sharedInstance] setDestinationTabView:nil]; 825 820 [self smoothlyArrangeTabs]; 826 [self resetCursorTracking];827 821 828 822 //Pass event along to the windowController … … 907 901 while((tabCell = [enumerator nextObject])){ 908 902 NSRect trackRect = [tabCell frame]; 909 [tabCell addTrackingRects InView:self withFrame:trackRect cursorLocation:localPoint];903 [tabCell addTrackingRectsWithFrame:trackRect cursorLocation:localPoint]; 910 904 } 911 905 … … 923 917 enumerator = [tabCellArray objectEnumerator]; 924 918 while((tabCell = [enumerator nextObject])){ 925 [tabCell removeTrackingRects FromView:self];919 [tabCell removeTrackingRects]; 926 920 } 927 921 trunk/ESFloater.m
r1823 r2039 15 15 16 16 @interface ESFloater (PRIVATE) 17 - (id)initWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask title:(NSString *) title;17 - (id)initWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask; 18 18 - (void)_setWindowOpacity:(float)opacity; 19 19 @end … … 22 22 23 23 // 24 + (id)floaterWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask title:(NSString *) title24 + (id)floaterWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask 25 25 { 26 return([[self alloc] initWithImage:inImage styleMask:styleMask title:title]);26 return([[self alloc] initWithImage:inImage styleMask:styleMask]); 27 27 } 28 28 29 29 // 30 - (id)initWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask title:(NSString *) title30 - (id)initWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask 31 31 { 32 32 NSRect frame; … … 44 44 backing:NSBackingStoreBuffered 45 45 defer:NO]; 46 if( title ) [panel setTitle:title];47 46 [panel setHidesOnDeactivate:NO]; 48 47 [panel setIgnoresMouseEvents:YES]; … … 127 126 128 127 if(windowIsVisible){ 129 alphaValue += (maxOpacity - alphaValue) * ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSShiftKeyMask? WINDOW_FADE_SLOW_STEP : WINDOW_FADE_STEP);128 alphaValue += (maxOpacity - alphaValue) * (( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSShiftKeyMask ) ? WINDOW_FADE_SLOW_STEP : WINDOW_FADE_STEP); 130 129 if(alphaValue > maxOpacity - WINDOW_FADE_SNAP) alphaValue = maxOpacity; 131 130 }else{ 132 alphaValue -= (alphaValue - WINDOW_FADE_MIN) * ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSShiftKeyMask? WINDOW_FADE_SLOW_STEP : WINDOW_FADE_STEP);131 alphaValue -= (alphaValue - WINDOW_FADE_MIN) * (( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSShiftKeyMask ) ? WINDOW_FADE_SLOW_STEP : WINDOW_FADE_STEP); 133 132 if(alphaValue < WINDOW_FADE_MIN + WINDOW_FADE_SNAP) alphaValue = WINDOW_FADE_MIN; 134 133 }
