Author: mlytwyn
Date: Fri Jun 26 04:03:03 2015
New Revision: 38689

URL: http://svn.gna.org/viewcvs/gnustep?rev=38689&view=rev
Log:
GSAutoCompleteWindow/Color/ColorWell/ColorList merges

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/GSAutocompleteWindow.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSColor.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSColorList.m
    libs/gui/branches/gnustep_testplant_branch/Source/NSColorWell.m

Modified: 
libs/gui/branches/gnustep_testplant_branch/Source/GSAutocompleteWindow.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/GSAutocompleteWindow.m?rev=38689&r1=38688&r2=38689&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/GSAutocompleteWindow.m    
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/GSAutocompleteWindow.m    
Fri Jun 26 04:03:03 2015
@@ -182,13 +182,20 @@
         }
     }
   
+#if 0
+  // Testplant-MAL-2015-06-25: Fix for main branch code...
   // String size caching could cache one of our strings with the wrong sizing
   widestWord = [NSString stringWithFormat:@"%@#",widestWord];
-  
+  // Width
+  windowWidth  = ([cell _sizeText: widestWord].width + [NSScroller 
scrollerWidth] + 2*bsize.width);
+  //  windowWidth *= 1.1;
+#else
+  // Testplant-MAL-2015-06-25: GUI main branch code...
   // Width
   cell = [[_tableView tableColumnWithIdentifier: @"content"] dataCell];
-  windowWidth  = ([cell _sizeText: widestWord].width + [NSScroller 
scrollerWidth] + 2*bsize.width);
-  //  windowWidth *= 1.1;
+  windowWidth = 1.1*[cell _sizeText: widestWord].width
+    + [NSScroller scrollerWidth] + 2*bsize.width;
+#endif
 
   //Height
   windowHeight = 2*bsize.height + [_tableView rowHeight]*num
@@ -203,6 +210,9 @@
   NSRect  rect;
   NSRect  stringRect;
   NSPoint point;
+  NSInterfaceStyle style;
+
+  style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil);
 
   rect = [self frame];
   screenFrame = [[[_textView window] screen] frame];
@@ -215,7 +225,17 @@
           [_textView convertRect: stringRect toView: nil].origin];
 
   // Calculate the origin point to the window.
-  rect.origin.x = point.x; // - [NSScroller scrollerWidth] - 4;
+  // Testplant-MAL-2015-06-25: Main branch code merge...
+  if (style == NSMacintoshInterfaceStyle
+      || style == NSWindows95InterfaceStyle)
+    {
+      rect.origin.x = point.x - 4;
+    }
+  else
+    {
+      // Testplant-MAL-2015-06-25: Testplant branch code...
+      rect.origin.x = point.x; // - [NSScroller scrollerWidth] - 4;
+    }
   rect.origin.y = point.y - rect.size.height;
 
   // If part of the window is off screen, change the origin point.

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSColor.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSColor.m?rev=38689&r1=38688&r2=38689&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSColor.m (original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSColor.m Fri Jun 26 
04:03:03 2015
@@ -40,6 +40,7 @@
 #import <Foundation/NSDebug.h>
 #import <Foundation/NSScanner.h>
 
+#import "AppKit/NSBezierPath.h"
 #import "AppKit/NSColor.h"
 #import "AppKit/NSColorList.h"
 #import "AppKit/NSColorSpace.h"
@@ -202,12 +203,14 @@
   
   colorStrings = [[NSMutableDictionary alloc]
                     initWithObjectsAndKeys:
+                    black, @"alternateSelectedControlColor",
+                    white, @"alternateSelectedControlTextColor",
                     lightGray, @"controlBackgroundColor",
                     lightGray, @"controlColor",
+                    black, @"controlDarkShadowColor",
                     lightGray, @"controlHighlightColor",
                     white, @"controlLightHighlightColor",
                     darkGray, @"controlShadowColor",
-                    black, @"controlDarkShadowColor",
                     black, @"controlTextColor",
                     darkGray, @"disabledControlTextColor",
                     gray, @"gridColor",
@@ -216,7 +219,11 @@
                     white, @"highlightColor",
                     black, @"keyboardFocusIndicatorColor",
                     lightGray, @"knobColor",
+                    black, @"labelColor",
+                    black, @"quaternaryLabelColor",
                     gray, @"scrollBarColor",
+                    black, @"secondaryLabelColor",
+                    lightGray, @"secondarySelectedControlColor",
                     white, @"selectedControlColor",
                     black, @"selectedControlTextColor",
                     lightGray, @"selectedKnobColor",
@@ -225,18 +232,15 @@
                     lightGray, @"selectedTextBackgroundColor",
                     black, @"selectedTextColor",
                     black, @"shadowColor",
+                    black, @"tertiaryLabelColor",
                     white, @"textBackgroundColor",
                     black, @"textColor",
                     lightGray, @"windowBackgroundColor",
                     black, @"windowFrameColor",
                     white, @"windowFrameTextColor",
-                    black, @"alternateSelectedControlColor",
-                    white, @"alternateSelectedControlTextColor",
+
                     white, @"rowBackgroundColor",
                     lightGray, @"alternateRowBackgroundColor",
-                    lightGray, @"secondarySelectedControlColor",
-                    //gray, @"windowFrameColor",
-                    //black, @"windowFrameTextColor",
                     nil];
   
   systemColors = RETAIN([NSColorList colorListNamed: @"System"]);
@@ -739,6 +743,11 @@
   return systemColorWithName(@"controlColor");
 }
 
++ (NSColor*) controlDarkShadowColor
+{
+  return systemColorWithName(@"controlDarkShadowColor");
+}
+
 + (NSColor*) controlHighlightColor
 {
   return systemColorWithName(@"controlHighlightColor");
@@ -754,11 +763,6 @@
   return systemColorWithName(@"controlShadowColor");
 }
 
-+ (NSColor*) controlDarkShadowColor
-{
-  return systemColorWithName(@"controlDarkShadowColor");
-}
-
 + (NSColor*) controlTextColor
 {
   return systemColorWithName(@"controlTextColor");
@@ -799,11 +803,26 @@
   return systemColorWithName(@"knobColor");
 }
 
++ (NSColor*) labelColor
+{
+  return systemColorWithName(@"labelColor");
+}
+
++ (NSColor*) quaternaryLabelColor
+{
+  return systemColorWithName(@"quaternaryLabelColor");
+}
+
 + (NSColor*) scrollBarColor
 {
   return systemColorWithName(@"scrollBarColor");
 }
 
++ (NSColor*) secondaryLabelColor
+{
+  return systemColorWithName(@"secondaryLabelColor");
+}
+
 + (NSColor*) secondarySelectedControlColor
 {
   return systemColorWithName(@"secondarySelectedControlColor");
@@ -847,6 +866,11 @@
 + (NSColor*) shadowColor
 {
   return systemColorWithName(@"shadowColor");
+}
+
++ (NSColor*) tertiaryLabelColor
+{
+  return systemColorWithName(@"tertiaryLabelColor");
 }
 
 + (NSColor*) textBackgroundColor
@@ -1364,6 +1388,24 @@
 //
 - (void) drawSwatchInRect: (NSRect)rect
 {
+  // Testplant-MAL-2015-06-25 Merged with GUI trunk...
+  if ([self alphaComponent] < 1.0)
+    {
+      NSBezierPath *triangle = [NSBezierPath bezierPath];
+
+      [[NSColor whiteColor] set];
+      NSRectFill(rect);
+
+      [triangle moveToPoint: NSMakePoint(rect.origin.x,
+               rect.origin.y + rect.size.height)];
+      [triangle lineToPoint: NSMakePoint(rect.origin.x + rect.size.width, 
+               rect.origin.y + rect.size.height)];
+      [triangle lineToPoint: rect.origin];
+      [triangle closePath];
+      [[NSColor blackColor] set];
+      [triangle fill];
+    }
+
   [self set];
   NSRectFill(rect);
 }
@@ -1515,6 +1557,7 @@
         }
       else if (colorSpace == 6)
         {
+          // Testplant-MAL-2015-06-25: This fixes the main branch code...
           self = [[GSNamedColor alloc] initWithCoder:aDecoder];
         }
       else if (colorSpace == 10)
@@ -1858,6 +1901,7 @@
 
 + (void) initialize
 {
+  // Testplant-MAL-2015-06-25: Fix for main branch code...
   if (self == [GSNamedColor class])
   {
     namedColorLock = [NSRecursiveLock new];
@@ -2032,6 +2076,7 @@
       [aCoder encodeInt: 6 forKey: @"NSColorSpace"];
       [aCoder encodeObject: _catalog_name forKey: @"NSCatalogName"];
       [aCoder encodeObject: _color_name forKey: @"NSColorName"];
+      // Testplant-MAL-2015-06-25: Fix for main branch code...
       [aCoder encodeObject: _cached_color forKey:@"NSColor"];
     }
   else 
@@ -2047,6 +2092,7 @@
   NSString     *listName   = nil;
   NSString     *colorName  = nil;
   
+  // Testplant-MAL-2015-06-25: Fix for main branch code...
   if ([aDecoder allowsKeyedCoding])
     {
       listName               = [aDecoder decodeObjectForKey: @"NSCatalogName"];

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSColorList.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSColorList.m?rev=38689&r1=38688&r2=38689&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSColorList.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSColorList.m     Fri Jun 
26 04:03:03 2015
@@ -535,8 +535,20 @@
 {
   if ([aCoder allowsKeyedCoding])
     {
-      // FIXME
-    }
+      NSMutableArray *colors = [[NSMutableArray alloc] init];
+      NSInteger i;
+
+      for (i = 0; i < [_orderedColorKeys count]; i++)
+        {
+          NSString *name = [_orderedColorKeys objectAtIndex: i];
+          [colors insertObject: [_colorDictionary objectForKey: name]
+                       atIndex: i];
+    }
+      [aCoder encodeObject: _name forKey: @"NSName"];
+      [aCoder encodeObject: _orderedColorKeys forKey: @"NSKeys"];
+      [aCoder encodeObject: colors forKey: @"NSColors"];
+      RELEASE(colors);
+     }
   else
     {
       [aCoder encodeObject: _name];
@@ -549,7 +561,14 @@
 {
   if ([aDecoder allowsKeyedCoding])
     {
-      // FIXME
+      NSArray *colors;
+
+      ASSIGN(_name, [aDecoder decodeObjectForKey: @"NSName"]);
+      ASSIGN(_orderedColorKeys, [aDecoder decodeObjectForKey: @"NSKeys"]);
+      colors = [aDecoder decodeObjectForKey: @"NSColors"];
+      _colorDictionary = [[NSMutableDictionary alloc]
+                           initWithObjects: colors
+                                   forKeys: _orderedColorKeys];
     }
   else
     {

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSColorWell.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSColorWell.m?rev=38689&r1=38688&r2=38689&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSColorWell.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSColorWell.m     Fri Jun 
26 04:03:03 2015
@@ -185,7 +185,7 @@
   _wellRect = [[GSTheme theme] drawColorWellBorder: self
                                withBounds: _bounds
                                withClip: clipRect];
-  [self drawWellInside: NSIntersectionRect(_wellRect, clipRect)];
+  [self drawWellInside: _wellRect];
 }
 
 /**<p>Draws the NSColorWell inside the rectangle <var>insideRect</var>.</p>
@@ -196,22 +196,6 @@
   if (NSIsEmptyRect(insideRect))
     {
       return;
-    }
-  if ([_the_color alphaComponent] < 1.0)
-    {
-      NSBezierPath *triangle = [NSBezierPath bezierPath];
-
-      [[NSColor whiteColor] set];
-      NSRectFill(insideRect);
-
-      [triangle moveToPoint: NSMakePoint(insideRect.origin.x,
-               insideRect.origin.y + insideRect.size.height)];
-      [triangle lineToPoint: NSMakePoint(insideRect.origin.x + 
insideRect.size.width, 
-               insideRect.origin.y + insideRect.size.height)];
-      [triangle lineToPoint: insideRect.origin];
-      [triangle closePath];
-      [[NSColor blackColor] set];
-      [triangle fill];
     }
   [_the_color drawSwatchInRect: insideRect];
 }
@@ -305,7 +289,9 @@
 
 - (BOOL) isOpaque
 {
-  return _is_bordered;
+  // Testplant-MAL-2015-06-25: main branch code merge...
+  // May not be opaque, due to themes
+  return NO;
 }
 
 - (void) mouseDown: (NSEvent *)theEvent


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to