Author: fredkiefer
Date: Mon Nov 21 23:33:53 2016
New Revision: 40229

URL: http://svn.gna.org/viewcvs/gnustep?rev=40229&view=rev
Log:
        * Headers/AppKit/NSColorPanel.h: Change -alpha to CGFloat.
        * Source/NSColorPanel.m: Remove left over GModel loading code.
        Set default mode to colour wheel.
        Small cleanups mostly in comments.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Headers/AppKit/NSColorPanel.h
    libs/gui/trunk/Source/NSColorPanel.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Mon Nov 21 23:33:53 2016
@@ -1,3 +1,10 @@
+2016-11-21 Fred Kiefer <fredkie...@gmx.de>
+
+       * Headers/AppKit/NSColorPanel.h: Change -alpha to CGFloat.
+       * Source/NSColorPanel.m: Remove left over GModel loading code.
+       Set default mode to colour wheel.
+       Small cleanups mostly in comments.
+
 2016-11-21 Fred Kiefer <fredkie...@gmx.de>
 
        * Source/NSColorPanel.m (-_initWithoutGModel): Correct target for

Modified: libs/gui/trunk/Headers/AppKit/NSColorPanel.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Headers/AppKit/NSColorPanel.h?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- libs/gui/trunk/Headers/AppKit/NSColorPanel.h        (original)
+++ libs/gui/trunk/Headers/AppKit/NSColorPanel.h        Mon Nov 21 23:33:53 2016
@@ -132,7 +132,7 @@
         fromView:(NSView *)sourceView;
 - (void)setColor:(NSColor *)aColor;
 
-- (float)alpha;
+- (CGFloat)alpha;
 - (NSColor *)color;
 
 @end

Modified: libs/gui/trunk/Source/NSColorPanel.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSColorPanel.m?rev=40229&r1=40228&r2=40229&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSColorPanel.m        (original)
+++ libs/gui/trunk/Source/NSColorPanel.m        Mon Nov 21 23:33:53 2016
@@ -56,8 +56,6 @@
 #import "AppKit/NSSplitView.h"
 #import "AppKit/NSWindow.h"
 #import "GNUstepGUI/GSDisplayServer.h"
-#import "GNUstepGUI/IMLoading.h"
-
 
 #import "GSGuiPrivate.h"
 
@@ -65,8 +63,7 @@
 static NSLock *_gs_gui_color_panel_lock = nil;
 static NSColorPanel *_gs_gui_color_panel = nil;
 static int _gs_gui_color_picker_mask = NSColorPanelAllModesMask;
-// FIXME: This should be NSWheelModeColorPanel 
-static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
+static int _gs_gui_color_picker_mode = NSWheelModeColorPanel;
 
 
 @implementation NSApplication (NSColorPanel)
@@ -86,7 +83,6 @@
 @interface NSColorPanel (PrivateMethods)
 - (void) _loadPickers;
 - (void) _loadPickerAtPath: (NSString *)path;
-- (void) _fixupMatrix;
 - (void) _setupPickers;
 - (void) _showNewPicker: (id)sender;
 - (id) _initWithoutGModel;
@@ -154,18 +150,6 @@
          NSLog(@"%@ does not contain a valid color picker.", path);
        }
     }
-}
-
-// FIXME - this is a HACK to get around problems in the gmodel code
-- (void) _fixupMatrix
-{
-  NSButtonCell *prototype;
-
-  [_pickerMatrix setFrame: NSMakeRect(4, 190, 192, 36)];
-  prototype = [[NSButtonCell alloc] initImageCell: nil];
-  [prototype setButtonType: NSOnOffButton];
-  [_pickerMatrix setPrototype: prototype];
-  RELEASE(prototype);
 }
 
 - (void) _setupPickers
@@ -462,6 +446,8 @@
       [_gs_gui_color_panel_lock lock];
       if (!_gs_gui_color_panel)
         {
+          //  if (![NSBundle loadNibNamed: @"ColorPanel" owner: self]);
+
          // Keep this two lines separated so the check in [init] works.
          _gs_gui_color_panel = [self alloc];
          [_gs_gui_color_panel init];
@@ -491,9 +477,9 @@
   _gs_gui_color_picker_mode = mode;
 }
 
-/**<p>Drags <var>aColor</var> frome <var>sourceView</var> at the location
+/**<p>Drags <var>aColor</var> from <var>sourceView</var> at the location
    give by the event <var>anEvent</var> ( [NSView-convertPoint:fromView:] ).
-   The type declare into the pasteboard is NSColorPboardType</p>
+   The type declared into the pasteboard is NSColorPboardType</p>
    <p>See Also: [NSView-convertPoint:fromView:] 
    [NSView-dragImage:at:offset:event:pasteboard:source:slideBack:</p>
  */
@@ -539,7 +525,6 @@
       return _gs_gui_color_panel;
   }
 
-  //  if (![NSBundle loadNibNamed: @"ColorPanel" owner: self]);
   [self _initWithoutGModel];
 
   [self _loadPickers];
@@ -593,7 +578,7 @@
 }
 
 /**<p> Sets the accessoryView to a view. The old view ( if exists ) will be 
-    remove ( and release ). You need to retain it if you want to use
+    removed ( and released ). You need to retain it if you want to use
     it later</p>
     <p>See Also: -accessoryView</p>
  */
@@ -610,8 +595,8 @@
 
 /**<p>Sets the NSColorPanl action method to <var>aSelector</var> The
    action message is usally send in -setColor:, when the picker is updated,
-   when a new picker is show, when the alpha is changed or when one of the
-   color well at the bottom is selected.</p>
+   when a new picker is shown, when the alpha is changed or when one of the
+   color wells at the bottom is selected.</p>
  */
 - (void) setAction: (SEL)aSelector
 {
@@ -660,7 +645,7 @@
   if (flag)
     {
       NSRect newFrame = [_pickerBox frame];
-      float offset = [_alphaSlider frame].size.height + 4;
+      CGFloat offset = [_alphaSlider frame].size.height + 4.0;
 
       [_alphaSlider setFrameOrigin: newFrame.origin];
       [[_pickerBox superview] addSubview: _alphaSlider];
@@ -670,7 +655,7 @@
     }
   else
     {
-      // Remove the alpha slider, and add its size to the pickeBox
+      // Remove the alpha slider, and add its size to the pickerBox
       [_alphaSlider removeFromSuperview];
       [_pickerBox setFrame: NSUnionRect([_pickerBox frame],
                                         [_alphaSlider frame])];
@@ -718,7 +703,7 @@
     1.0 if the NSColorPanel does not show alpha</p>
     <p>See Also: -showsAlpha -setShowsAlpha:</p>    
  */
-- (float) alpha
+- (CGFloat) alpha
 {
   if ([self showsAlpha])
     return [_alphaSlider floatValue] / MAX_ALPHA_VALUE;
@@ -734,7 +719,7 @@
   return [_colorWell color];
 }
 
-/** <p>Sets the NSColor displayed to aColor. This method post a
+/** <p>Sets the NSColor displayed to aColor. This method posts a
     NSColorPanelColorDidChangeNotification notification if needed.</p>
     <p>See Also: -color [NSColorWell-setColor:]
     </p>


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to