The purpose of this feature is to create theme for every object of the AppKit. Previously, we could not theme object like CPColor, however CPColor could be very interesting to theme, value like alternateSelectedControlColor were hard coded in the framework. With this PR, we can now theme a CPColor and take some values from the current theme of the application. Then, this PR offers the possibility to refactor the themeDescriptors, some classes contains theme attributes for other class (CPTabView and CPTabViewItem for instance).
How doe it work ? A new category _CPObject+Theme.j has been added to the AppKit. This category contains every theme methods needed to theme an object (previously this category was in CPView). We add utils method like _encodeThemeObjectsWithCoder: and _decodeThemeObjectsWithCoder: in this category to be able to code and decode easily a coder for every object (this is generic).
This PR did not refactor the themeDescriptors, it only add this new mechanism for the methods alternateSelectedControlColor and secondarySelectedControlColor of CPColor. We will need to refactor that gradually
This color has a standard 'transparency' checkerboard pattern which is especially useful for our scrolling tests where it makes scrolling easy to visualise.
Refs #2078, #2079.
Previously, the parameters to CPColor colorWithHue:saturation:brightness: could be specified below 0 or above 1.0.
Now the values are clamped so that values below 0 are taken as 0 and values above 1.0 and taken as 1.0.
Previously, - CPColor hsbComponents returned degrees and percents. With the latest change to - CPColor colorWithHue:saturation:brightness: this was inconsistent.
Now - CPColor hsbComponents returns its components as factors in the 0-1.0 range.
Previously, + CPColor colorWithHue:saturation:brightness: took its parameters as degrees and percent (e.g. hue between 0º and 360º, saturation and brightness between 0% and 100%). However, in Cocoa the components are given as factors (0.0-1.0) like other colour methods.
This fix makes + CPColor colorWithHue:saturation:brightness: work like in Cocoa.
- Made CPDescriptionOfObject smarter about detecting CG objects
- CPObject, CPArray, CPDictionary do a better (as in perfect) job of indenting nested objects
- CPDictionary is displayed using Cocoa-style key = value; notation
Syntax such as [[CPColor colorWithCSSString:@"rgba(0,0,0,0.5)"] cssString] lead to a CSS string incompatible with browsers without the CSS rgba feature.
- Enhanced -description method of CPImage and CPColor to show the exact content, especially for pattern colors.
- Added CPColorWithImages() convenience function, analogous to PatternColor() function used in theme descriptors.
- Added @cond/@endcond in CPColor to ignore local variables.
- Sample app included.
The old DOM based fields only accepted a few characters. Backspace and
other expected functionality was broken. Switching to CPTextFields
makes them behave as expected.