mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 02:40:38 +00:00
* Source/NSMenuView.m ([NSMenuView -trackWithEvent:]):
new tracking code. The menu feels snappier now (at least for me). * Source/NSColorWell.m ([-activate:], [-deactivate]) register/unregister for NSColorPanelColorChangedNotification. ([NSColorWell _takeColorFromPanel:]): new method to prevent endless loop when setting the well's color from the color panel. ([NSColorWell -initWithCoder:]): register for NSColorPboardType. * Source/NSColorPanel.m ([NSColorPanel -_bottomWellAction:]): called when hitting one of the well at the bottom of the panel. Previous behaviour would not send a NSColorPanelColorChangedNotification. ([NSColorPanel -initWithCoder:]): update bottom wells construction to call _bottomWellAction: instead of takeColorFrom:. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14853 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
48ecaabf8b
commit
90645a5f8a
4 changed files with 50 additions and 36 deletions
|
@ -86,6 +86,11 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
name: GSColorWellDidBecomeExclusiveNotification
|
||||
object: nil];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(_takeColorFromPanel:)
|
||||
name: NSColorPanelColorChangedNotification
|
||||
object: nil];
|
||||
|
||||
_is_active = YES;
|
||||
|
||||
[colorPanel setColor: _the_color];
|
||||
|
@ -233,6 +238,8 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
// Undo RETAIN by decoder
|
||||
TEST_RELEASE(_target);
|
||||
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
|
||||
[self registerForDraggedTypes:
|
||||
[NSArray arrayWithObjects: NSColorPboardType, nil]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -346,6 +353,19 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
}
|
||||
}
|
||||
|
||||
- (void) _takeColorFromPanel: (NSNotification *) notification
|
||||
{
|
||||
id sender = [notification object];
|
||||
|
||||
if ([sender respondsToSelector: @selector(color)])
|
||||
{
|
||||
ASSIGN(_the_color, [(id)sender color]);
|
||||
|
||||
[self sendAction: _action to: _target];
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) target
|
||||
{
|
||||
return _target;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue