From c7f81691bff7a9ffd5d73d967111c071175c0a4e Mon Sep 17 00:00:00 2001 From: Nabil Elisa Date: Fri, 19 Jun 2009 21:28:34 +0100 Subject: [PATCH 1/2] Added more colors to satisfy issue #182 --- AppKit/CPColor.j | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index d4188c92e..464ddecb3 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -46,6 +46,11 @@ var cachedBlackColor, cachedLightGrayColor, cachedDarkGrayColor, cachedWhiteColor, + cachedBrownColor, + cachedCyanColor, + cachedMagentaColor, + cachedOrangeColor, + cachedPurpleColor, cachedShadowColor, cachedClearColor; @@ -291,6 +296,61 @@ var cachedBlackColor, return cachedYellowColor; } +/*! + Returns a brown color object (RGBA=[0.6, 0.4, 0.2, 1.0]) +*/ ++ (CPColor)brownColor +{ + if (!cachedBrownColor) + cachedBrownColor = [[CPColor alloc] _initWithRGBA:[0.6, 0.4, 0.2, 1.0]]; + + return cachedBrownColor; +} + +/*! + Returns a cyan color object (RGBA=[0.0, 1.0, 1.0, 1.0]) +*/ ++ (CPColor)cyanColor +{ + if (!cachedCyanColor) + cachedCyanColor = [[CPColor alloc] _initWithRGBA:[0.0, 1.0, 1.0, 1.0]]; + + return cachedCyanColor; +} + +/*! + Returns a magenta color object (RGBA=[1.0, 0.0, 1.0, 1.0]) +*/ ++ (CPColor)magentaColor +{ + if (!cachedMagentaColor) + cachedMagentaColor = [[CPColor alloc] _initWithRGBA:[1.0, 0.0, 1.0, 1.0]]; + + return cachedMagentaColor; +} + +/*! + Returns a orange color object (RGBA=[1.0, 0.5, 0.0, 1.0]) +*/ ++ (CPColor)orangeColor +{ + if (!cachedOrangeColor) + cachedOrangeColor = [[CPColor alloc] _initWithRGBA:[1.0, 0.5, 0.0, 1.0]]; + + return cachedOrangeColor; +} + +/*! + Returns a purple color object (RGBA=[0.5, 0.0, 0.5, 1.0]) +*/ ++ (CPColor)purpleColor +{ + if (!cachedPurpleColor) + cachedPurpleColor = [[CPColor alloc] _initWithRGBA:[0.5, 0.0, 0.5, 1.0]]; + + return cachedPurpleColor; +} + /*! Returns a shadow looking color (RGBA=[0.0, 0.0, 0.0, 0.33]) */ From 7d158de356edde342fa6f0e4d9e8c4704a76218c Mon Sep 17 00:00:00 2001 From: Saikat Chakrabarti Date: Sat, 20 Jun 2009 17:12:03 -0700 Subject: [PATCH 2/2] Fix for incorrect chain received mouseEntered events. Closes #199. Reviewed by me. --- AppKit/CPWindow/CPWindow.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index e2ef55142..48a9968c6 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1234,10 +1234,10 @@ CPTexturedBackgroundWindowMask var deviation = MIN(_mouseEnteredStack.length, mouseEnteredStack.length); while (deviation--) - if (_mouseEnteredStack[deviation] !== mouseEnteredStack[deviation]) + if (_mouseEnteredStack[deviation] === mouseEnteredStack[deviation]) break; - var index = deviation, + var index = deviation + 1, count = _mouseEnteredStack.length; if (index < count) @@ -1248,7 +1248,7 @@ CPTexturedBackgroundWindowMask [_mouseEnteredStack[index] mouseExited:event]; } - index = deviation; + index = deviation + 1; count = mouseEnteredStack.length; if (index < count)