* Source/NSColorWell.m (-mouseDragged:, -mouseDown:): Applied patch from Eric Wasylishen to activate it on click inside the colored rectangle (same behavior as in OS X)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29106 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Hans Baier 2009-12-08 07:55:39 +00:00
parent cd8dd3494f
commit 8a86e63b77
2 changed files with 24 additions and 9 deletions

View file

@ -1,3 +1,8 @@
2009-12-08 Hans Baier <hansfbaier@googlemail.com>
* Source/NSColorWell.m (-mouseDragged:, -mouseDown:): Applied
patch from Eric Wasylishen to activate it on click inside the
colored rectangle (same behavior as in OS X)
2009-12-06 Quentin Mathe <quentin.mathe@gmail.com>
* Source/NSOutlineView.m (-draggingUpdated:):

View file

@ -46,6 +46,8 @@
static NSString *GSColorWellDidBecomeExclusiveNotification =
@"GSColorWellDidBecomeExclusiveNotification";
static NSPoint _lastMouseDownPoint;
@implementation NSColorWell
/*
@ -289,16 +291,11 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
//
if ([self isEnabled])
{
NSPoint point = [self convertPoint: [theEvent locationInWindow]
fromView: nil];
_lastMouseDownPoint =
[self convertPoint: [theEvent locationInWindow]
fromView: nil];
if ([self mouse: point inRect: _wellRect])
{
[NSColorPanel dragColor: _the_color
withEvent: theEvent
fromView: self];
}
else if (_is_active == NO)
if (_is_active == NO)
{
[self activate: YES];
}
@ -309,6 +306,19 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
}
}
- (void) mouseDragged: (NSEvent *)theEvent
{
if ([self isEnabled])
{
if ([self mouse: _lastMouseDownPoint inRect: _wellRect])
{
[NSColorPanel dragColor: _the_color
withEvent: theEvent
fromView: self];
}
}
}
- (BOOL) performDragOperation: (id <NSDraggingInfo>)sender
{
NSPasteboard *pb = [sender draggingPasteboard];