diff --git a/ChangeLog b/ChangeLog index b6eca9c34..567c469ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2021-10-27 Gregory John Casamento + + * Source/NSPopUpButtonCell.m + * Source/NSTabView.m + * Source/NSTextContainer.m + * Source/NSTextFieldCell.m + * Source/NSTextField.m + * Source/NSTextView.m + * Source/NSWindowController.m: Remaining improvements and stability + changes contributed by testplant. + 2021-10-27 Gregory John Casamento * Source/GSToolbarView.m: Toolbar fixes to prevent the index diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 1aadb99e1..506cf1139 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -123,7 +123,8 @@ static NSImage *_pbc_image[5]; [self _initMenu]; [self setPullsDown: flag]; - _pbcFlags.usesItemFromMenu = YES; + [self setAltersStateOfSelectedItem: YES]; + [self setUsesItemFromMenu: YES]; [self setPreferredEdge: NSMaxYEdge]; [self setArrowPosition: NSPopUpArrowAtCenter]; diff --git a/Source/NSTabView.m b/Source/NSTabView.m index 09bbbfeef..04dc3ac47 100644 --- a/Source/NSTabView.m +++ b/Source/NSTabView.m @@ -570,6 +570,10 @@ ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]); [_items makeObjectsPerformSelector: @selector(_setTabView:) withObject: self]; } + else + { + ASSIGN(_items, [NSMutableArray array]); + } if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"]) { // N.B.: As a side effect, this discards the subview frame diff --git a/Source/NSTextContainer.m b/Source/NSTextContainer.m index 5d1fee8a6..5cf2a1f01 100644 --- a/Source/NSTextContainer.m +++ b/Source/NSTextContainer.m @@ -96,12 +96,12 @@ use bounds rectangle instead of frame? */ NSDebugLLog(@"NSText", @"NSTextContainer initWithContainerSize"); if (aSize.width < 0) { - NSWarnMLog(@"given negative width"); + NSWarnMLog(@"given negative width: %f current: %f", aSize.width, _containerRect.size.width); aSize.width = 0; } if (aSize.height < 0) { - NSWarnMLog(@"given negative height"); + NSWarnMLog(@"given negative height: %f current: %f", aSize.height, _containerRect.size.height); aSize.height = 0; } _layoutManager = nil; @@ -246,12 +246,12 @@ framework intact. if (aSize.width < 0) { - NSWarnMLog(@"given negative width"); + NSWarnMLog(@"given negative width: %f current: %f", aSize.width, _containerRect.size.width); aSize.width = 0; } if (aSize.height < 0) { - NSWarnMLog(@"given negative height"); + NSWarnMLog(@"given negative height: %f current: %f", aSize.height, _containerRect.size.height); aSize.height = 0; } diff --git a/Source/NSTextField.m b/Source/NSTextField.m index 0235fd9ee..48624312b 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -134,7 +134,7 @@ static Class textFieldCellClass; */ - (BOOL) isSelectable { - return [_cell isSelectable]; + return [_cell isSelectable] && [self isEnabled]; } /**

Sets whether the NSTextField's cell and the NSText object is editable. diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 9c2754eed..f60b2447e 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -250,10 +250,10 @@ NSAttributedString *attrStr; attrStr = [super _drawAttributedString]; - if (attrStr == nil) + if ((attrStr == nil) || ([[attrStr string] length] == 0)) { attrStr = [self placeholderAttributedString]; - if (attrStr == nil) + if ((attrStr == nil) || ([[attrStr string] length] == 0)) { NSString *string; NSDictionary *attributes; @@ -286,6 +286,14 @@ } } +- (void) _updateFieldEditor: (NSText*)textObject +{ + [super _updateFieldEditor: textObject]; + [textObject setDrawsBackground: _textfieldcell_draws_background]; + [textObject setBackgroundColor: _background_color]; + [textObject setTextColor: _text_color]; +} + - (BOOL) isOpaque { if (_textfieldcell_draws_background == NO diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 1823d1f92..f137fdfbd 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -6466,13 +6466,15 @@ or add guards - (void) _scheduleTextCheckingTimer { - [_textCheckingTimer invalidate]; - _textCheckingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 - target: self - selector: @selector(_textCheckingTimerFired:) - userInfo: [NSValue valueWithRect: [self visibleRect]] - repeats: NO]; - + if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSDisableSpellCheckerServer"] == NO) + { + [_textCheckingTimer invalidate]; + _textCheckingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 + target: self + selector: @selector(_textCheckingTimerFired:) + userInfo: [NSValue valueWithRect: [self visibleRect]] + repeats: NO]; + } } - (void) _scheduleTextCheckingInVisibleRectIfNeeded diff --git a/Source/NSWindowController.m b/Source/NSWindowController.m index d0b3962c0..75aa31cb4 100644 --- a/Source/NSWindowController.m +++ b/Source/NSWindowController.m @@ -282,7 +282,8 @@ * Apple's implementation doesn't seem to deal with this case, and * crashes if isReleaseWhenClosed is set. */ - RETAIN(_window); + if ([_window isReleasedWhenClosed]) + RETAIN(_window); [self setWindow: nil]; [_document _removeWindowController: self];