mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
* Source/NSColorWell.m: Add a minimum distance which you need to
drag the color from a well before it is treated as a drag. TODO: Unify this with the dragging threshold in other parts of gui and make a user default called GSDragThreshold, maybe? git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29377 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3497c38603
commit
fa1f260116
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-01-23 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSColorWell.m: Add a minimum distance which you need to
|
||||
drag the color from a well before it is treated as a drag.
|
||||
TODO: Unify this with the dragging threshold in other parts of
|
||||
gui and make a user default called GSDragThreshold, maybe?
|
||||
|
||||
2010-01-23 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSWindowDecorationView.m: In drawRect:, clear the window
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "GNUstepGUI/GSTheme.h"
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <math.h>
|
||||
|
||||
static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||
@"GSColorWellDidBecomeExclusiveNotification";
|
||||
|
@ -333,6 +334,14 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
BOOL inside = [self mouse: point inRect: [self bounds]];
|
||||
BOOL startedInWell = [self mouse: _mouseDownPoint inRect: _wellRect];
|
||||
|
||||
NSSize delta = NSMakeSize(_mouseDownPoint.x - point.x,
|
||||
_mouseDownPoint.y - point.y);
|
||||
double distance = sqrt(delta.width*delta.width + delta.height*delta.height);
|
||||
|
||||
// FIXME: Make the dragging threshold a user default
|
||||
if (distance < 4)
|
||||
return;
|
||||
|
||||
if ([self isEnabled] == NO)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue