mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:27:40 +00:00
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:
parent
f14cc1f3bc
commit
621fb86745
2 changed files with 24 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue