mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Minor cleaning/tidying up in -mouseDown:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11937 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a9ab96ca32
commit
df7e037dab
1 changed files with 20 additions and 15 deletions
|
@ -2137,12 +2137,12 @@ afterString in order over charRange. */
|
|||
|
||||
startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
|
||||
startIndex = [self characterIndexForPoint: startPoint];
|
||||
|
||||
|
||||
if ([_textStorage containsAttachments])
|
||||
{
|
||||
NSTextAttachment *attachment;
|
||||
|
||||
// Check if the click was on an attachment cell
|
||||
/* Check if the click was on an attachment cell. */
|
||||
attachment = [_textStorage attribute: NSAttachmentAttributeName
|
||||
atIndex: startIndex
|
||||
effectiveRange: NULL];
|
||||
|
@ -2150,20 +2150,25 @@ afterString in order over charRange. */
|
|||
if (attachment != nil)
|
||||
{
|
||||
id <NSTextAttachmentCell> cell = [attachment attachmentCell];
|
||||
// FIXME: Where to get the cellFrame?
|
||||
NSRect cellFrame = NSMakeRect(0, 0, 0, 0);
|
||||
|
||||
if ((cell != nil) &&
|
||||
([cell wantsToTrackMouseForEvent: theEvent
|
||||
inRect: cellFrame
|
||||
ofView: self
|
||||
atCharacterIndex: startIndex] == YES) &&
|
||||
([cell trackMouse: theEvent
|
||||
inRect: cellFrame
|
||||
ofView: self
|
||||
atCharacterIndex: startIndex
|
||||
untilMouseUp: NO] == YES))
|
||||
return;
|
||||
if (cell != nil)
|
||||
{
|
||||
/* FIXME: Where to get the cellFrame? */
|
||||
NSRect cellFrame = NSMakeRect(0, 0, 0, 0);
|
||||
|
||||
if ([cell wantsToTrackMouseForEvent: theEvent
|
||||
inRect: cellFrame
|
||||
ofView: self
|
||||
atCharacterIndex: startIndex]
|
||||
&& [cell trackMouse: theEvent
|
||||
inRect: cellFrame
|
||||
ofView: self
|
||||
atCharacterIndex: startIndex
|
||||
untilMouseUp: NO])
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue