mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 08:41:00 +00:00
Color dragging minor improvement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9162 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a002d02682
commit
7106a1459a
3 changed files with 57 additions and 60 deletions
|
@ -5,6 +5,9 @@
|
||||||
1. colorwell should not deactivate when panel is closed.
|
1. colorwell should not deactivate when panel is closed.
|
||||||
2. setting color of an active well should set the color of the panel
|
2. setting color of an active well should set the color of the panel
|
||||||
(though it should not raise it).
|
(though it should not raise it).
|
||||||
|
* Source/NSColorPanel.m: Minor tidy.
|
||||||
|
* Images/common_ColorSwatch.tiff: Updated to same size as NeXTstep
|
||||||
|
color swatch.
|
||||||
|
|
||||||
Sun Feb 18 13:35:55 2001 Nicola Pero <n.pero@mi.flashnet.it>
|
Sun Feb 18 13:35:55 2001 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -92,17 +92,21 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
|
|
||||||
bundleEnumerator = [bundles objectEnumerator];
|
bundleEnumerator = [bundles objectEnumerator];
|
||||||
while ((bundleName = [bundleEnumerator nextObject]))
|
while ((bundleName = [bundleEnumerator nextObject]))
|
||||||
|
{
|
||||||
[self _loadPickerAtPath:
|
[self _loadPickerAtPath:
|
||||||
[path stringByAppendingPathComponent: bundleName]];
|
[path stringByAppendingPathComponent: bundleName]];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
paths = [[NSBundle mainBundle] pathsForResourcesOfType: @"bundle"
|
paths = [[NSBundle mainBundle] pathsForResourcesOfType: @"bundle"
|
||||||
inDirectory: @"ColorPickers"];
|
inDirectory: @"ColorPickers"];
|
||||||
|
|
||||||
pathEnumerator = [paths objectEnumerator];
|
pathEnumerator = [paths objectEnumerator];
|
||||||
while ((path = [pathEnumerator nextObject]))
|
while ((path = [pathEnumerator nextObject]))
|
||||||
|
{
|
||||||
[self _loadPickerAtPath: path];
|
[self _loadPickerAtPath: path];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) _loadPickerAtPath: (NSString *)path
|
- (void) _loadPickerAtPath: (NSString *)path
|
||||||
{
|
{
|
||||||
|
@ -121,9 +125,11 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
[_pickers addObject: picker];
|
[_pickers addObject: picker];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
NSLog(@"%@ does not contain a valid color picker.", path);
|
NSLog(@"%@ does not contain a valid color picker.", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME - this is a HACK to get around problems in the gmodel code
|
// FIXME - this is a HACK to get around problems in the gmodel code
|
||||||
- (void) _fixupMatrix
|
- (void) _fixupMatrix
|
||||||
|
@ -341,9 +347,9 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
|
|
||||||
@implementation NSColorPanel
|
@implementation NSColorPanel
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Class methods
|
* Class methods
|
||||||
//
|
*/
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
if (self == [NSColorPanel class])
|
if (self == [NSColorPanel class])
|
||||||
|
@ -354,9 +360,6 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Creating the NSColorPanel
|
|
||||||
//
|
|
||||||
+ (NSColorPanel *)sharedColorPanel
|
+ (NSColorPanel *)sharedColorPanel
|
||||||
{
|
{
|
||||||
if (_gs_gui_color_panel == nil)
|
if (_gs_gui_color_panel == nil)
|
||||||
|
@ -390,9 +393,6 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
return (_gs_gui_color_panel == nil) ? NO : YES;
|
return (_gs_gui_color_panel == nil) ? NO : YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Setting the NSColorPanel
|
|
||||||
//
|
|
||||||
+ (void) setPickerMask: (int)mask
|
+ (void) setPickerMask: (int)mask
|
||||||
{
|
{
|
||||||
_gs_gui_color_picker_mask = mask;
|
_gs_gui_color_picker_mask = mask;
|
||||||
|
@ -403,9 +403,6 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
_gs_gui_color_picker_mode = mode;
|
_gs_gui_color_picker_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Setting Color
|
|
||||||
//
|
|
||||||
+ (BOOL) dragColor: (NSColor *)aColor
|
+ (BOOL) dragColor: (NSColor *)aColor
|
||||||
withEvent: (NSEvent *)anEvent
|
withEvent: (NSEvent *)anEvent
|
||||||
fromView: (NSView *)sourceView
|
fromView: (NSView *)sourceView
|
||||||
|
@ -429,9 +426,9 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// Instance methods
|
* Instance methods
|
||||||
//
|
*/
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
|
@ -448,9 +445,6 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Setting the NSColorPanel
|
|
||||||
//
|
|
||||||
- (NSView *) accessoryView
|
- (NSView *) accessoryView
|
||||||
{
|
{
|
||||||
return _accessoryView;
|
return _accessoryView;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue