From f9bdd044b1c388e7ad6ec61fb9db043f66bcf13e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rivaille Date: Wed, 18 Sep 2002 18:00:30 +0000 Subject: [PATCH] * Source/NSSplitView.m ([NSSplitView -initWithCoder:]): set _never_displayed_before to YES. * Source/NSFont.m: rearrange the last change to make it look like other classes' initWithCoder/encodeWithCoder * Source/NSTextView.m: do not call _blink directly (suggested by Nicola Pero). * Source/NSButtonCell.m ([NSButtonCell -drawInteriorWithFrame:inView:]): if the button is NSImageOnly, draw the dotted frame at the right location. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14483 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 13 +++++++++++++ Source/NSButtonCell.m | 2 ++ Source/NSFont.m | 33 +++++++++++++++++++-------------- Source/NSSplitView.m | 2 +- Source/NSTextView.m | 12 ++++++------ 5 files changed, 41 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 951d38396..42a395569 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-09-18 Pierre-Yves Rivaille + + * Source/NSSplitView.m ([NSSplitView -initWithCoder:]): + set _never_displayed_before to YES. + * Source/NSFont.m: rearrange the last change to make + it look like other classes' initWithCoder/encodeWithCoder + * Source/NSTextView.m: do not call _blink directly + (suggested by Nicola Pero). + * Source/NSButtonCell.m + ([NSButtonCell -drawInteriorWithFrame:inView:]): + if the button is NSImageOnly, draw the dotted frame at + the right location. + 2002-09-16 19:28 Alexander Malmberg * Source/NSFont (+initialize, -initWithCoder:, -encodeWithCoder:): diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 97abda376..63252f6ee 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -856,6 +856,8 @@ { if (_cell.is_bordered || _cell.is_bezeled) NSDottedFrameRect(cellFrame); + else if (ipos == NSImageOnly) + NSDottedFrameRect(cellFrame); else NSDottedFrameRect(titleRect); } diff --git a/Source/NSFont.m b/Source/NSFont.m index 64ae60aab..f7cca93b2 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -50,6 +50,8 @@ static BOOL userFixedCacheNeedsRecomputing = NO; matrix: (const float*)fontMatrix; @end +static int currentVersion = 2; + /** NSFont @@ -166,7 +168,7 @@ setNSFont(NSString* key, NSFont* font) defaults = RETAIN([NSUserDefaults standardUserDefaults]); } - [self setVersion: 2]; + [self setVersion: currentVersion]; } } @@ -780,25 +782,28 @@ setNSFont(NSString* key, NSFont* font) { int version = [aDecoder versionForClassName: @"NSFont"]; - id name; - float fontMatrix[6]; - - name = [aDecoder decodeObject]; - [aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix]; - self = [self initWithName: name matrix: fontMatrix]; - - if (version == 2) + if (version == currentVersion) { + id name; + float fontMatrix[6]; + + name = [aDecoder decodeObject]; + [aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix]; + self = [self initWithName: name matrix: fontMatrix]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &matrixExplicitlySet]; } else { + id name; + float fontMatrix[6]; + + name = [aDecoder decodeObject]; + [aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix]; + self = [self initWithName: name matrix: fontMatrix]; if (fontMatrix[0] == fontMatrix[3] - && fontMatrix[1]==0.0 - && fontMatrix[2]==0.0) - { - matrixExplicitlySet = NO; - } + && fontMatrix[1] == 0.0 + && fontMatrix[2] == 0.0) + matrixExplicitlySet = NO; } return self; } diff --git a/Source/NSSplitView.m b/Source/NSSplitView.m index f2f059403..8aaa870f7 100644 --- a/Source/NSSplitView.m +++ b/Source/NSSplitView.m @@ -931,7 +931,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect) * */ _dividerWidth = [self dividerThickness]; - + _never_displayed_before = YES; return self; } diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 3bab9591a..f8aaf53d7 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -1770,8 +1770,6 @@ static NSNotificationCenter *nc; /* Start blinking timer if not yet started */ if (_insertionPointTimer == nil && [self shouldDrawInsertionPoint]) { - _drawInsertionPointNow = NO; - [self _blink: nil]; _insertionPointTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(_blink:) @@ -1783,9 +1781,8 @@ static NSNotificationCenter *nc; { [_insertionPointTimer invalidate]; DESTROY (_insertionPointTimer); - [self setNeedsDisplayInRect: oldInsertionPointRect]; - _drawInsertionPointNow = NO; - [self _blink: nil]; + [self setNeedsDisplayInRect: oldInsertionPointRect + avoidAdditionalLayout: YES]; _insertionPointTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(_blink:) @@ -1799,12 +1796,15 @@ static NSNotificationCenter *nc; * possible. */ _drawInsertionPointNow = YES; + [self setNeedsDisplayInRect: _insertionPointRect + avoidAdditionalLayout: YES]; } else { if (_insertionPointTimer != nil) { - [self setNeedsDisplayInRect: oldInsertionPointRect]; + [self setNeedsDisplayInRect: oldInsertionPointRect + avoidAdditionalLayout: YES]; [_insertionPointTimer invalidate]; DESTROY (_insertionPointTimer);