Handle correctly the mouse cursor in NSSearchField.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36595 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-05-06 22:58:46 +00:00
parent f14cc1f3bc
commit 621fb86745
2 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2013-05-06 German A. Arias <german@xelalug.org>
* Source/NSSearchFieldCell.m: Add method -resetCursorRect:inView: and an
inline method to handle correctly the mouse cursor.
2013-04-24 05:23-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/AppKit/NSPopover.h: correct delegate method

View file

@ -59,6 +59,19 @@
@implementation NSSearchFieldCell
#define ICON_WIDTH 16
// Inlined method
static inline NSRect textCellFrameFromRect(NSRect cellRect)
// Not the drawed part, precises just the part which receives events
{
return NSMakeRect(cellRect.origin.x + ICON_WIDTH,
NSMinY(cellRect),
NSWidth(cellRect) - 2*ICON_WIDTH,
NSHeight(cellRect));
}
- (id) initTextCell:(NSString *)aString
{
self = [super initTextCell: aString];
@ -306,8 +319,6 @@
[c setKeyEquivalentModifierMask: 0];
}
#define ICON_WIDTH 16
- (NSRect) cancelButtonRectForBounds: (NSRect)rect
{
NSRect part, clear;
@ -442,6 +453,12 @@
untilMouseUp: untilMouseUp];
}
- (void) resetCursorRect: (NSRect)cellFrame inView: (NSView *)controlView
{
[super resetCursorRect: textCellFrameFromRect(cellFrame)
inView: controlView];
}
- (void) textDidChange: (NSNotification *)notification
{
NSText *textObject;