mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-30 15:33:35 +00:00
fontpanel color well fix
This commit is contained in:
@@ -248,7 +248,7 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"],
|
||||
if (![self isVisible])
|
||||
return;
|
||||
|
||||
var attribs = [textView typingAttributes],
|
||||
var attribs = [textView _attributesForFontPanel],
|
||||
font = [attribs objectForKey:CPFontAttributeName] || [[textView textStorage] font] || [CPFont systemFontOfSize:12.0],
|
||||
color = [attribs objectForKey:CPForegroundColorAttributeName];
|
||||
|
||||
|
||||
@@ -1341,6 +1341,16 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
[_delegate textViewDidChangeTypingAttributes:[[CPNotification alloc] initWithName:CPTextViewDidChangeTypingAttributesNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
- (CPDictionary)_attributesForFontPanel
|
||||
{
|
||||
var attributes = [[_textStorage attributesAtIndex:CPMaxRange(_selectionRange) effectiveRange:nil] copy];
|
||||
|
||||
if (![attributes containsKey:CPForegroundColorAttributeName])
|
||||
[attributes setObject:[self textColor] forKey:CPForegroundColorAttributeName];
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
- (void)delete:(id)sender
|
||||
{
|
||||
[self deleteBackward:sender];
|
||||
|
||||
Reference in New Issue
Block a user