From aeb89462c557f2b9f79c070b7ce30fa68f63faf7 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 31 Jul 2010 22:21:00 +0000 Subject: - Replace progress indicator CoreAnimation drawing with manual shadow/fade code; this addresses hangs (see Issue #6677) and also prevents triggering the discrete graphics chip on newer MacBook Pros. - Update localisable strings --- .../English.lproj/ProgressIndicatorLayer.xib | 1293 ++++++++++++++++++-- Resources/English.lproj/ExportDialog.strings | Bin 22102 -> 23334 bytes Resources/English.lproj/ImportAccessory.strings | Bin 6882 -> 7442 bytes Resources/English.lproj/Localizable.strings | Bin 159912 -> 159964 bytes Source/SPDatabaseDocument.m | 27 +- Source/YRKSpinningProgressIndicator.h | 1 + Source/YRKSpinningProgressIndicator.m | 24 +- 7 files changed, 1218 insertions(+), 127 deletions(-) diff --git a/Interfaces/English.lproj/ProgressIndicatorLayer.xib b/Interfaces/English.lproj/ProgressIndicatorLayer.xib index df62649f..a0bd2628 100644 --- a/Interfaces/English.lproj/ProgressIndicatorLayer.xib +++ b/Interfaces/English.lproj/ProgressIndicatorLayer.xib @@ -2,10 +2,10 @@ 1050 - 10D573 - 762 + 10F569 + 788 1038.29 - 460.00 + 461.00 YES @@ -15,17 +15,18 @@ YES - 762 + 788 1.2.5 YES + YES - com.brandonwalkin.BWToolkit com.apple.InterfaceBuilder.CocoaPlugin + com.brandonwalkin.BWToolkit YES @@ -48,7 +49,7 @@ NSApplication - + 301 YES @@ -77,16 +78,6 @@ 290 {{97, 30}, {326, 49}} - YES - - 1 - -1 - 2 - - 3 - MAA - - 2 YES @@ -155,13 +146,6 @@ 274 {{13, 79}, {73, 73}} - YES - - 1 - -1 - 1 - - 2 YRKSpinningProgressIndicator @@ -223,6 +207,7 @@ {437, 90} + 2 NSView @@ -382,6 +367,7 @@ 11.IBViewIntegration.shadowOffsetWidth 15.IBPluginDependency 15.IBViewIntegration.shadowBlurRadius + 15.IBViewIntegration.shadowColor 15.IBViewIntegration.shadowOffsetHeight 15.IBViewIntegration.shadowOffsetWidth 16.IBPluginDependency @@ -411,11 +397,15 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + 3 + MAA + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -443,11 +433,18 @@ - 38 + 44 YES + + NSApplication + + IBProjectSource + Frameworks/PSMTabBar/PSMTabDragAssistant.h + + NSDictionary @@ -473,7 +470,14 @@ NSObject IBProjectSource - Source/CMImageView.h + Frameworks/PSMTabBar/PSMTabBarCell.h + + + + NSObject + + IBProjectSource + Frameworks/PSMTabBar/PSMTabBarControl.h @@ -490,6 +494,20 @@ Source/SPContentFilterManager.h + + NSObject + + IBProjectSource + Source/SPImageView.h + + + + NSObject + + IBProjectSource + Source/SPMainThreadTrampoline.h + + NSObject @@ -510,9 +528,16 @@ toggleCollapse: id + + toggleCollapse: + + toggleCollapse: + id + + IBProjectSource - Source/TablesList.h + Source/SPTablesList.h @@ -552,6 +577,80 @@ id + + YES + + YES + doDecomposedStringWithCanonicalMapping: + doDecomposedStringWithCompatibilityMapping: + doPrecomposedStringWithCanonicalMapping: + doPrecomposedStringWithCompatibilityMapping: + doRemoveDiacritics: + doSelectionLowerCase: + doSelectionTitleCase: + doSelectionUpperCase: + doTranspose: + insertNULLvalue: + selectCurrentLine: + selectCurrentWord: + selectEnclosingBrackets: + + + YES + + doDecomposedStringWithCanonicalMapping: + id + + + doDecomposedStringWithCompatibilityMapping: + id + + + doPrecomposedStringWithCanonicalMapping: + id + + + doPrecomposedStringWithCompatibilityMapping: + id + + + doRemoveDiacritics: + id + + + doSelectionLowerCase: + id + + + doSelectionTitleCase: + id + + + doSelectionUpperCase: + id + + + doTranspose: + id + + + insertNULLvalue: + id + + + selectCurrentLine: + id + + + selectCurrentWord: + id + + + selectEnclosingBrackets: + id + + + IBProjectSource Source/SPTextViewAdditions.h @@ -566,7 +665,14 @@ SPDatabaseDocument - NSDocument + + IBProjectSource + Source/SPConnectionDelegate.h + + + + SPDatabaseDocument + NSObject YES @@ -580,36 +686,45 @@ checksumTable: chooseDatabase: chooseEncoding: - closeErrorConnectionSheet: closePanelSheet: closePasswordSheet: closeSheet: + copyChecksumFromSheet: copyCreateTableSyntax: copyCreateTableSyntaxFromSheet: + copyDatabase: export: - exportMultipleTables: - exportTable: + exportSelectedTablesAs: flushPrivileges: flushTable: + focusOnTableContentFilter: + focusOnTableListFilter: import: + importFromClipboard: openCurrentConnectionInNewWindow: optimizeTable: removeDatabase: + renameDatabase: repairTable: saveConnectionSheet: saveCreateSyntax: setDatabases: + showConsole: showCreateTableSyntax: showMySQLHelp: + showNavigator: showServerProcesses: showServerVariables: showUserManager: + toggleNavigator: + updateWindowTitle: validateSaveConnectionAccessory: viewContent: viewQuery: viewRelations: viewStatus: viewStructure: + viewTriggers: YES @@ -652,6 +767,264 @@ id id id + id + id + id + id + id + id + id + id + id + + + + YES + + YES + addConnectionToFavorites: + addDatabase: + analyzeTable: + backForwardInHistory: + cancelTask: + checkTable: + checksumTable: + chooseDatabase: + chooseEncoding: + closePanelSheet: + closePasswordSheet: + closeSheet: + copyChecksumFromSheet: + copyCreateTableSyntax: + copyCreateTableSyntaxFromSheet: + copyDatabase: + export: + exportSelectedTablesAs: + flushPrivileges: + flushTable: + focusOnTableContentFilter: + focusOnTableListFilter: + import: + importFromClipboard: + openCurrentConnectionInNewWindow: + optimizeTable: + removeDatabase: + renameDatabase: + repairTable: + saveConnectionSheet: + saveCreateSyntax: + setDatabases: + showConsole: + showCreateTableSyntax: + showMySQLHelp: + showNavigator: + showServerProcesses: + showServerVariables: + showUserManager: + toggleNavigator: + updateWindowTitle: + validateSaveConnectionAccessory: + viewContent: + viewQuery: + viewRelations: + viewStatus: + viewStructure: + viewTriggers: + + + YES + + addConnectionToFavorites: + id + + + addDatabase: + id + + + analyzeTable: + id + + + backForwardInHistory: + id + + + cancelTask: + id + + + checkTable: + id + + + checksumTable: + id + + + chooseDatabase: + id + + + chooseEncoding: + id + + + closePanelSheet: + id + + + closePasswordSheet: + id + + + closeSheet: + id + + + copyChecksumFromSheet: + id + + + copyCreateTableSyntax: + id + + + copyCreateTableSyntaxFromSheet: + id + + + copyDatabase: + id + + + export: + id + + + exportSelectedTablesAs: + id + + + flushPrivileges: + id + + + flushTable: + id + + + focusOnTableContentFilter: + id + + + focusOnTableListFilter: + id + + + import: + id + + + importFromClipboard: + id + + + openCurrentConnectionInNewWindow: + id + + + optimizeTable: + id + + + removeDatabase: + id + + + renameDatabase: + id + + + repairTable: + id + + + saveConnectionSheet: + id + + + saveCreateSyntax: + id + + + setDatabases: + id + + + showConsole: + id + + + showCreateTableSyntax: + id + + + showMySQLHelp: + id + + + showNavigator: + id + + + showServerProcesses: + id + + + showServerVariables: + id + + + showUserManager: + id + + + toggleNavigator: + id + + + updateWindowTitle: + id + + + validateSaveConnectionAccessory: + id + + + viewContent: + id + + + viewQuery: + id + + + viewRelations: + id + + + viewStatus: + id + + + viewStructure: + id + + + viewTriggers: + id + @@ -662,14 +1035,21 @@ chooseDatabaseButton connectionErrorDialog contentViewSplitter + copyDatabaseButton + copyDatabaseDataButton + copyDatabaseMessageField createTableSyntaxTextField createTableSyntaxTextView createTableSyntaxWindow customQueryInstance customQueryTextView + databaseCopyNameField + databaseCopySheet databaseDataInstance databaseEncodingButton databaseNameField + databaseRenameNameField + databaseRenameSheet databaseSheet dbTablesTableView encodingPopUp @@ -682,7 +1062,10 @@ inputTextWindowMessage inputTextWindowSecureTextField listFilterField + parentView queryProgressBar + renameDatabaseButton + renameDatabaseMessageField saveConnectionAccessory saveConnectionAutoConnect saveConnectionEncrypt @@ -693,6 +1076,10 @@ saveConnectionSavePasswordAlert sidebarGrabber spHistoryControllerInstance + statusTableAccessoryView + statusTableCopyChecksum + statusTableView + statusValues tableContentInstance tableDataInstance tableDumpInstance @@ -702,7 +1089,7 @@ tableRelationsInstance tableSourceInstance tableTabView - tableWindow + tableTriggersInstance tablesListInstance taskCancelButton taskCancellationCallbackObject @@ -712,67 +1099,514 @@ titleAccessoryView titleImageView titleStringView - userManagerInstance YES id id - NSWindow - NSSplitView - NSTextField - NSTextView - NSWindow - id - NSTextView - id - id - id - id - NSTableView - NSPopUpButton - id - id - id - id - id - id - id - id - NSSearchField - id - id - id - id - NSSecureTextField - id - id - id - id - id - id - id - id - id - NSButton - NSTableView - NSSplitView - id - id - NSTabView - id - id - NSButton - id - id - id - NSBox - id + NSWindow + NSSplitView + id + id + id + NSTextField + NSTextView + NSWindow + id + NSTextView + id + id + id + id + id + id + id + id + NSTableView + NSPopUpButton + id + id + id + id + id + id + id + id + NSSearchField + NSView + id + id + id + id + id + id + NSSecureTextField + id + id + id + id + id + id + id + id + id + id + id + id + id + NSButton + NSTableView + NSSplitView + id + id + NSTabView + id + id + NSButton + id + id + id + NSBox + id + id + id + + + + YES + + YES + addDatabaseButton + chooseDatabaseButton + connectionErrorDialog + contentViewSplitter + copyDatabaseButton + copyDatabaseDataButton + copyDatabaseMessageField + createTableSyntaxTextField + createTableSyntaxTextView + createTableSyntaxWindow + customQueryInstance + customQueryTextView + databaseCopyNameField + databaseCopySheet + databaseDataInstance + databaseEncodingButton + databaseNameField + databaseRenameNameField + databaseRenameSheet + databaseSheet + dbTablesTableView + encodingPopUp + exportControllerInstance + extendedTableInfoInstance + favoritesButton + historyControl + inputTextWindow + inputTextWindowHeader + inputTextWindowMessage + inputTextWindowSecureTextField + listFilterField + parentView + queryProgressBar + renameDatabaseButton + renameDatabaseMessageField + saveConnectionAccessory + saveConnectionAutoConnect + saveConnectionEncrypt + saveConnectionEncryptString + saveConnectionIncludeData + saveConnectionIncludeQuery + saveConnectionSavePassword + saveConnectionSavePasswordAlert + sidebarGrabber + spHistoryControllerInstance + statusTableAccessoryView + statusTableCopyChecksum + statusTableView + statusValues + tableContentInstance + tableDataInstance + tableDumpInstance + tableInfoCollapseButton + tableInfoTable + tableListSplitter + tableRelationsInstance + tableSourceInstance + tableTabView + tableTriggersInstance + tablesListInstance + taskCancelButton + taskCancellationCallbackObject + taskDescriptionText + taskProgressIndicator + taskProgressLayer + titleAccessoryView + titleImageView + titleStringView + + + YES + + addDatabaseButton + id + + + chooseDatabaseButton + id + + + connectionErrorDialog + NSWindow + + + contentViewSplitter + NSSplitView + + + copyDatabaseButton + id + + + copyDatabaseDataButton + id + + + copyDatabaseMessageField + id + + + createTableSyntaxTextField + NSTextField + + + createTableSyntaxTextView + NSTextView + + + createTableSyntaxWindow + NSWindow + + + customQueryInstance + id + + + customQueryTextView + NSTextView + + + databaseCopyNameField + id + + + databaseCopySheet + id + + + databaseDataInstance + id + + + databaseEncodingButton + id + + + databaseNameField + id + + + databaseRenameNameField + id + + + databaseRenameSheet + id + + + databaseSheet + id + + + dbTablesTableView + NSTableView + + + encodingPopUp + NSPopUpButton + + + exportControllerInstance + id + + + extendedTableInfoInstance + id + + + favoritesButton + id + + + historyControl + id + + + inputTextWindow + id + + + inputTextWindowHeader + id + + + inputTextWindowMessage + id + + + inputTextWindowSecureTextField + id + + + listFilterField + NSSearchField + + + parentView + NSView + + + queryProgressBar + id + + + renameDatabaseButton + id + + + renameDatabaseMessageField + id + + + saveConnectionAccessory + id + + + saveConnectionAutoConnect + id + + + saveConnectionEncrypt + id + + + saveConnectionEncryptString + NSSecureTextField + + + saveConnectionIncludeData + id + + + saveConnectionIncludeQuery + id + + + saveConnectionSavePassword + id + + + saveConnectionSavePasswordAlert + id + + + sidebarGrabber + id + + + spHistoryControllerInstance + id + + + statusTableAccessoryView + id + + + statusTableCopyChecksum + id + + + statusTableView + id + + + statusValues + id + + + tableContentInstance + id + + + tableDataInstance + id + + + tableDumpInstance + id + + + tableInfoCollapseButton + NSButton + + + tableInfoTable + NSTableView + + + tableListSplitter + NSSplitView + + + tableRelationsInstance + id + + + tableSourceInstance + id + + + tableTabView + NSTabView + + + tableTriggersInstance + id + + + tablesListInstance + id + + + taskCancelButton + NSButton + + + taskCancellationCallbackObject + id + + + taskDescriptionText + id + + + taskProgressIndicator + id + + + taskProgressLayer + NSBox + + + titleAccessoryView + id + + + titleImageView + id + + + titleStringView + id + + + + + IBProjectSource + Source/SPDatabaseDocument.h + + + + SPDatabaseDocument + + IBProjectSource + Source/SPPrintController.h + + + + SPDatabaseDocument + NSObject + + YES + + YES + closeErrorConnectionSheet: + exportMultipleTables: + exportTable: + + + YES + id + id id + + + + YES + + YES + closeErrorConnectionSheet: + exportMultipleTables: + exportTable: + + + YES + + closeErrorConnectionSheet: + id + + + exportMultipleTables: + id + + + exportTable: + id + + + + + YES + + YES + tableWindow + userManagerInstance + + + YES id SPUserManager + + YES + + YES + tableWindow + userManagerInstance + + + YES + + tableWindow + id + + + userManagerInstance + SPUserManager + + + IBUserSource @@ -786,11 +1620,14 @@ YES addHost: + addSchemaPriv: addUser: checkAllPrivileges: doApply: doCancel: + refresh: removeHost: + removeSchemaPriv: removeUser: uncheckAllPrivileges: @@ -804,23 +1641,189 @@ id id id + id + id + id + + + + YES + + YES + addHost: + addSchemaPriv: + addUser: + checkAllPrivileges: + doApply: + doCancel: + refresh: + removeHost: + removeSchemaPriv: + removeUser: + uncheckAllPrivileges: + + + YES + + addHost: + id + + + addSchemaPriv: + id + + + addUser: + id + + + checkAllPrivileges: + id + + + doApply: + id + + + doCancel: + id + + + refresh: + id + + + removeHost: + id + + + removeSchemaPriv: + id + + + removeUser: + id + + + uncheckAllPrivileges: + id + YES YES + addSchemaPrivButton + availableController + availableTableView + grantedController + grantedTableView outlineView privsSupportedByServer + removeSchemaPrivButton + schemaController + schemasTableView + splitViewButtonBar tabView treeController + userNameTextField YES + NSButton + NSArrayController + NSTableView + NSArrayController + NSTableView NSOutlineView NSMutableDictionary + NSButton + NSArrayController + NSTableView + BWAnchoredButtonBar NSTabView NSTreeController + NSTextField + + + + YES + + YES + addSchemaPrivButton + availableController + availableTableView + grantedController + grantedTableView + outlineView + privsSupportedByServer + removeSchemaPrivButton + schemaController + schemasTableView + splitViewButtonBar + tabView + treeController + userNameTextField + + + YES + + addSchemaPrivButton + NSButton + + + availableController + NSArrayController + + + availableTableView + NSTableView + + + grantedController + NSArrayController + + + grantedTableView + NSTableView + + + outlineView + NSOutlineView + + + privsSupportedByServer + NSMutableDictionary + + + removeSchemaPrivButton + NSButton + + + schemaController + NSArrayController + + + schemasTableView + NSTableView + + + splitViewButtonBar + BWAnchoredButtonBar + + + tabView + NSTabView + + + treeController + NSTreeController + + + userNameTextField + NSTextField + @@ -835,7 +1838,6 @@ YES YES - animate: startAnimation: stopAnimation: @@ -843,7 +1845,25 @@ YES id id - id + + + + YES + + YES + startAnimation: + stopAnimation: + + + YES + + startAnimation: + id + + + stopAnimation: + id + @@ -854,6 +1874,30 @@ YES + + BWAnchoredButtonBar + NSView + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWAnchoredButtonBar.h + + + + BWTransparentButton + NSButton + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWTransparentButton.h + + + + BWTransparentButtonCell + NSButtonCell + + IBFrameworkSource + BWToolkitFramework.framework/Headers/BWTransparentButtonCell.h + + NSActionCell NSCell @@ -905,6 +1949,21 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSApplication + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSApplication+BWAdditions.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + NSBox NSView @@ -975,42 +2034,6 @@ Foundation.framework/Headers/NSKeyValueCoding.h - - NSDocument - NSObject - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentScripting.h - - NSFormatter NSObject @@ -1281,6 +2304,13 @@ Growl.framework/Headers/GrowlApplicationBridge.h + + NSObject + + IBFrameworkSource + Print.framework/Headers/PDEPluginInterface.h + + NSObject @@ -1504,6 +2534,13 @@ NSResponder + + NSView + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSView+BWAdditions.h + + NSWindow @@ -1526,6 +2563,13 @@ AppKit.framework/Headers/NSWindowScripting.h + + NSWindow + + IBFrameworkSource + BWToolkitFramework.framework/Headers/NSWindow+BWAdditions.h + + NSWindowController NSResponder @@ -1533,6 +2577,13 @@ showWindow: id + + showWindow: + + showWindow: + id + + IBFrameworkSource AppKit.framework/Headers/NSWindowController.h diff --git a/Resources/English.lproj/ExportDialog.strings b/Resources/English.lproj/ExportDialog.strings index 3200ff17..9dbf666e 100644 Binary files a/Resources/English.lproj/ExportDialog.strings and b/Resources/English.lproj/ExportDialog.strings differ diff --git a/Resources/English.lproj/ImportAccessory.strings b/Resources/English.lproj/ImportAccessory.strings index 06e341e9..88e4758a 100644 Binary files a/Resources/English.lproj/ImportAccessory.strings and b/Resources/English.lproj/ImportAccessory.strings differ diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings index 2f9650bd..70e42f3a 100644 Binary files a/Resources/English.lproj/Localizable.strings and b/Resources/English.lproj/Localizable.strings differ diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index bace5cb5..c2d4896c 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -226,6 +226,12 @@ // Set up the progress indicator child window and layer - change indicator color and size [taskProgressIndicator setForeColor:[NSColor whiteColor]]; + NSShadow *progressIndicatorShadow = [[NSShadow alloc] init]; + [progressIndicatorShadow setShadowOffset:NSMakeSize(1.0, -1.0)]; + [progressIndicatorShadow setShadowBlurRadius:1.0]; + [progressIndicatorShadow setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.75]]; + [taskProgressIndicator setShadow:progressIndicatorShadow]; + [progressIndicatorShadow release]; taskProgressWindow = [[NSWindow alloc] initWithContentRect:[taskProgressLayer bounds] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; [taskProgressWindow setReleasedWhenClosed:NO]; [taskProgressWindow setOpaque:NO]; @@ -1276,11 +1282,11 @@ // Set the task text. If a nil string was supplied, a generic query notification is occurring - // if a task is not already active, use default text. if (!description) { - if (!_isWorkingLevel) [taskDescriptionText setStringValue:NSLocalizedString(@"Working...", @"Generic working description")]; + if (!_isWorkingLevel) [self setTaskDescription:NSLocalizedString(@"Working...", @"Generic working description")]; // Otherwise display the supplied string } else { - [taskDescriptionText setStringValue:description]; + [self setTaskDescription:description]; } // Increment the task level @@ -1343,7 +1349,22 @@ */ - (void) setTaskDescription:(NSString *)description { - [taskDescriptionText setStringValue:description]; + NSShadow *shadow = [[NSShadow alloc] init]; + [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.75]]; + [shadow setShadowOffset:NSMakeSize(1.0, -1.0)]; + [shadow setShadowBlurRadius:3.0]; + + NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + [NSFont boldSystemFontOfSize:13.0], NSFontAttributeName, + shadow, NSShadowAttributeName, + nil]; + NSAttributedString *string = [[NSAttributedString alloc] initWithString:description attributes:attributes]; + + [taskDescriptionText setAttributedStringValue:string]; + + [string release]; + [attributes release]; + [shadow release]; } /** diff --git a/Source/YRKSpinningProgressIndicator.h b/Source/YRKSpinningProgressIndicator.h index 4be79805..e97711b2 100644 --- a/Source/YRKSpinningProgressIndicator.h +++ b/Source/YRKSpinningProgressIndicator.h @@ -18,6 +18,7 @@ NSColor *_foreColor; NSColor *_backColor; BOOL _drawBackground; + NSShadow *_shadow; NSTimer *_fadeOutAnimationTimer; BOOL _isFadingOut; diff --git a/Source/YRKSpinningProgressIndicator.m b/Source/YRKSpinningProgressIndicator.m index 4872b201..b6f3c0ac 100644 --- a/Source/YRKSpinningProgressIndicator.m +++ b/Source/YRKSpinningProgressIndicator.m @@ -56,6 +56,7 @@ _currentValue = 0.0; _maxValue = 100.0; _usesThreadedAnimation = NO; + _shadow = nil; } return self; } @@ -63,6 +64,7 @@ - (void) dealloc { if (_foreColor) [_foreColor release]; if (_backColor) [_backColor release]; + if (_shadow) [_shadow release]; if (_isAnimating) [self stopAnimation:self]; [super dealloc]; @@ -94,15 +96,17 @@ else maxSize = size.width; + CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; + [NSGraphicsContext saveGraphicsState]; + + if (_shadow) [_shadow set]; + // fill the background, if set if(_drawBackground) { [_backColor set]; [NSBezierPath fillRect:[self bounds]]; } - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - [NSGraphicsContext saveGraphicsState]; - // Move the CTM so 0,0 is at the center of our bounds CGContextTranslateCTM(currentContext,[self bounds].size.width/2,[self bounds].size.height/2); @@ -313,6 +317,20 @@ [self setNeedsDisplay:YES]; } +- (NSShadow *)shadow +{ + return [[_shadow retain] autorelease]; +} + +- (void)setShadow:(NSShadow *)value +{ + if (_shadow != value) { + [_shadow release]; + _shadow = [value copy]; + [self setNeedsDisplay:YES]; + } +} + - (BOOL)isIndeterminate { return _isIndeterminate; -- cgit v1.2.3