mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
Revert change to _setupTextWithFrame:..., now we again use always a clip
view, but with a different size, depending if the text should be scrollable. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24433 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0a9783724b
commit
eb5e01cf4f
2 changed files with 22 additions and 25 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-01-30 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSCell.m (-_setupTextWithFrame:inView:editor:delegate:range:,
|
||||
-endEditing:): Revert to always use a clip view, but with different size.
|
||||
|
||||
2007-01-29 Matt Rice <ratmice@gmail.com>
|
||||
|
||||
* Source/NSTableView.m: Revert previous patch.
|
||||
|
|
|
@ -2117,31 +2117,29 @@ static NSColor *shadowCol;
|
|||
range: (NSRange)selection
|
||||
{
|
||||
NSRect titleRect = [self titleRectForBounds: aRect];
|
||||
NSClipView *cv = [[NSClipView alloc] initWithFrame: titleRect];
|
||||
NSTextContainer *ct = [(NSTextView*)textObject textContainer];
|
||||
NSRect maxRect;
|
||||
|
||||
// A clip view should is only created for scrollable text
|
||||
if ([self isScrollable])
|
||||
{
|
||||
/* See comments in NSStringDrawing.m about the choice of maximum size. */
|
||||
NSSize maxSize = NSMakeSize(1e6, titleRect.size.height);
|
||||
NSClipView *cv = [[NSClipView alloc] initWithFrame: titleRect];
|
||||
NSTextContainer *ct = [(NSTextView*)textObject textContainer];
|
||||
|
||||
maxRect = NSMakeRect(0, 0, maxSize.width, maxSize.height);
|
||||
[controlView addSubview: cv];
|
||||
RELEASE(cv);
|
||||
[cv setAutoresizesSubviews: NO];
|
||||
[cv setDocumentView: textObject];
|
||||
[ct setContainerSize: maxSize];
|
||||
[ct setHeightTracksTextView: NO];
|
||||
[ct setWidthTracksTextView: NO];
|
||||
maxRect = NSMakeRect(0, 0, 1e6, titleRect.size.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
maxRect = titleRect;
|
||||
[controlView addSubview: textObject];
|
||||
maxRect = NSMakeRect(0, 0, titleRect.size.width, titleRect.size.height);
|
||||
}
|
||||
|
||||
[controlView addSubview: cv];
|
||||
RELEASE(cv);
|
||||
[cv setAutoresizesSubviews: NO];
|
||||
[cv setDocumentView: textObject];
|
||||
[ct setContainerSize: maxRect.size];
|
||||
[ct setHeightTracksTextView: NO];
|
||||
[ct setWidthTracksTextView: NO];
|
||||
|
||||
[textObject setFrame: maxRect];
|
||||
[textObject setHorizontallyResizable: NO];
|
||||
[textObject setVerticallyResizable: NO];
|
||||
|
@ -2187,21 +2185,15 @@ static NSColor *shadowCol;
|
|||
*/
|
||||
- (void) endEditing: (NSText*)textObject
|
||||
{
|
||||
NSClipView *clipView;
|
||||
|
||||
[textObject setString: @""];
|
||||
[textObject setDelegate: nil];
|
||||
|
||||
if ([self isScrollable])
|
||||
{
|
||||
NSClipView *clipView;
|
||||
|
||||
clipView = (NSClipView*)[textObject superview];
|
||||
[textObject removeFromSuperview];
|
||||
[clipView removeFromSuperview];
|
||||
}
|
||||
else
|
||||
{
|
||||
[textObject removeFromSuperview];
|
||||
}
|
||||
clipView = (NSClipView*)[textObject superview];
|
||||
[textObject removeFromSuperview];
|
||||
[clipView removeFromSuperview];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue