diff --git a/Headers/gnustep/gui/NSColorPanel.h b/Headers/gnustep/gui/NSColorPanel.h index 50a7f932d..6672a7bfa 100644 --- a/Headers/gnustep/gui/NSColorPanel.h +++ b/Headers/gnustep/gui/NSColorPanel.h @@ -29,6 +29,7 @@ #ifndef _GNUstep_H_NSColorPanel #define _GNUstep_H_NSColorPanel +#include #include #include #include @@ -64,6 +65,10 @@ enum { NSColorPanelAllModesMask = 127 }; +@interface NSApplication (NSColorPanel) +- (void) orderFrontColorPanel: (id)sender; +@end + @interface NSColorPanel : NSPanel { // Attributes diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index bc14ff084..9462bc1b4 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -41,7 +41,6 @@ #include #include #include -#include #include #define MAX_ALPHA_VALUE 100.0 @@ -51,6 +50,21 @@ static int _gs_gui_color_picker_mask = NSColorPanelAllModesMask; // FIXME: This should be NSWheelModeColorPanel static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; + +@implementation NSApplication (NSColorPanel) + +- (void) orderFrontColorPanel: sender +{ + NSColorPanel *colorPanel = [NSColorPanel sharedColorPanel]; + + if (colorPanel) + [colorPanel orderFront: nil]; + else + NSBeep(); +} + +@end + @interface NSColorPanel (PrivateMethods) - (void) _loadPickers; - (void) _loadPickerAtPath: (NSString *)path;