diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index e8b673c7c..6901a4422 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -84,7 +84,7 @@ var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_ _itemInfosForItems = { }; _disclosureControlsForRows = []; - [self setIndentationPerLevel:25.0]; + [self setIndentationPerLevel:16.0]; [self setIndentationMarkerFollowsDataView:YES]; [super setDataSource:[[_CPOutlineViewTableViewDataSource alloc] initWithOutlineView:self]]; @@ -327,7 +327,7 @@ var CPOutlineViewDataSource_outlineView_setObjectValue_forTableColumn_byItem_ - (CGRect)frameOfOutlineDataViewAtColumn:(CPInteger)aColumn row:(CPInteger)aRow { var frame = [super frameOfDataViewAtColumn:aColumn row:aRow], - indentationWidth = [self levelForRow:aRow] * [self indentationPerLevel] + (_disclosureControlPrototype ? _CGRectGetWidth([_disclosureControlPrototype frame]) : 0.0); + indentationWidth = ([self levelForRow:aRow] + 1) * [self indentationPerLevel]; frame.origin.x += indentationWidth; frame.size.width -= indentationWidth; diff --git a/AppKit/CPWindowController.j b/AppKit/CPWindowController.j index 0562465a3..2bbd8bc06 100644 --- a/AppKit/CPWindowController.j +++ b/AppKit/CPWindowController.j @@ -49,9 +49,6 @@ id _cibOwner; CPString _windowCibName; CPString _windowCibPath; - - BOOL _isWindowLoading; - BOOL _shouldDisplayWindowWhenLoaded; } - (id)init @@ -74,9 +71,6 @@ [self setShouldCloseDocument:NO]; [self setNextResponder:CPApp]; - - if (aWindow) - [self windowDidLoad]; } return self; @@ -127,36 +121,12 @@ /*! Loads the window */ -- (BOOL)loadWindow +- (void)loadWindow { - if ([self isWindowLoaded]) - return YES; + if (_window) + return; - if (![self isWindowLoading]) - { - _isWindowLoading = YES; - - [self windowWillLoad]; - - [CPBundle loadCibFile:[self windowCibPath] - externalNameTable:[CPDictionary dictionaryWithObject:_cibOwner forKey:CPCibOwner] - loadDelegate:self]; - } - - return NO; -} - -- (void)cibDidFinishLoading:(CPCib)aCib -{ - if (_window === nil && _document !== nil && _cibOwner === _document) - [self setWindow:[_document valueForKey:@"window"]]; - - [self synchronizeWindowTitleWithDocumentName]; - - [self windowDidLoad]; - - if (_shouldDisplayWindowWhenLoaded) - [self showWindow:self]; + [[CPBundle bundleForClass:[_cibOwner class]] loadCibFile:[self windowCibPath] externalNameTable:[CPDictionary dictionaryWithObject:_cibOwner forKey:CPCibOwner]]; } /*! @@ -165,13 +135,6 @@ */ - (@action)showWindow:(id)aSender { - if (![self loadWindow]) - { - _shouldDisplayWindowWhenLoaded = YES; - - return; - } - var theWindow = [self window]; if ([theWindow respondsToSelector:@selector(becomesKeyOnlyIfNeeded)] && [theWindow becomesKeyOnlyIfNeeded]) @@ -189,18 +152,26 @@ return _window !== nil; } -- (BOOL)isWindowLoading -{ - return _isWindowLoading; -} - /*! Returns the window this object controls. */ - (CPWindow)window { if (!_window) - [self loadWindow]; + { + [self windowWillLoad]; + [_document windowControllerWillLoadCib:self]; + + [self loadWindow]; + + if (_window === nil && _document !== nil && _cibOwner === _document) + [self setWindow:[_document valueForKey:@"window"]]; + + [self windowDidLoad]; + [_document windowControllerDidLoadCib:self]; + + [self synchronizeWindowTitleWithDocumentName]; + } return _window; } diff --git a/AppKit/Cib/CPCibLoading.j b/AppKit/Cib/CPCibLoading.j index 74607ae2e..8c6d282e5 100644 --- a/AppKit/Cib/CPCibLoading.j +++ b/AppKit/Cib/CPCibLoading.j @@ -56,9 +56,9 @@ var LoadInfoForCib = {}; [self loadCibFile:path externalNameTable:[CPDictionary dictionaryWithObject:anOwner forKey:CPCibOwner]]; } -- (void)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable loadDelegate:(id)aDelegate +- (void)loadCibFile:(CPString)aFileName externalNameTable:(CPDictionary)aNameTable { - [[[CPCib alloc] initWithCibNamed:aFileName bundle:self] instantiateCibWithExternalNameTable:aNameTable]; + [[[CPCib alloc] initWithContentsOfURL:aFileName] instantiateCibWithExternalNameTable:aNameTable]; } + (void)loadCibFile:(CPString)anAbsolutePath externalNameTable:(CPDictionary)aNameTable loadDelegate:aDelegate