Commit Graph
71 Commits
Author SHA1 Message Date
Martin Carlberg 42c629ca45 Fixed: Use ’;’ instead of ’,’ 2015-10-27 09:03:55 +01:00
Martin Carlberg 68f45beb20 Fixed: Code formatting 2015-10-27 09:03:26 +01:00
Martin Carlberg ed12bae6aa Fixed: Removed unused global variable 2015-10-23 16:38:12 +02:00
Martin Carlberg 1520c1ebab Fixed: Linting 2015-10-23 15:40:45 +02:00
Martin Carlberg 790190e5c3 Fixed: Removed code collecting statistic of theme attribute creation and some logging 2015-10-23 10:39:52 +02:00
Martin Carlberg 8397685430 Fixed: Joined caches for theme attributes for better performance
Conflicts:
	AppKit/CPTheme.j
2015-10-23 10:19:02 +02:00
Martin Carlberg fc411c5c1c Fixed: Cache ThemeAttribute
Conflicts:
	AppKit/CPTheme.j
2015-10-23 10:18:03 +02:00
Martin Carlberg 3a91f43bbb Fixed: Test cases are working correctly 2015-10-21 12:26:39 +02:00
Martin Carlberg 9946987f69 Fixed: Cache ThemeState for better performance 2015-10-21 12:26:12 +02:00
Alexandre Wilhelm 525747dc53 New: possibility to create a theme for every object of the Appkit
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
2015-08-21 15:54:00 -07:00
Antoine Mercadal f9275a70af FIXED: New warnings reveleaded by ivar type checking
This patch fixes all new warnings
2014-11-06 10:17:05 -08:00
Christophe Serafin 12c427a9cf enable CPControl to use setControlSize. Created an example with CPStepper 2014-08-01 16:57:02 -07:00
Mathieu Monney 7bd27ebd52 Fixed: Crash of press tool due to theme attribute not set
When using the press tool, it can happen that one of the theme attribute is not set as not everything is instantiated. 

This fix makes sure that the attribute is set before accessing it to avoid any crash of the press tool.
2014-06-24 15:37:59 +02:00
Alexander Ljungberg 050fcf2ab8 New: CPThemeStateFirstResponder for CPView.
When a CPView becomes the first responder it now takes on the 'first responder' theme state, as does all its subviews. This allows it to naturally change appearance when it has the keyboard focus, such as with focus rings and brighter colour schemes.
2014-05-11 15:48:37 +01:00
Saikat Chakrabarti 45df8c0f74 Fix bug with unsetThemeState + more tests. 2014-03-09 15:15:11 -07:00
Alexander Ljungberg e6acc3c336 Fixed: missing var, minor tweaks.
Refs #2073.
2014-03-06 14:03:46 +00:00
Saikat Chakrabarti b6b4015a82 Introduce .and and .without syntax for ThemeStates. 2014-03-01 23:26:20 -08:00
Saikat Chakrabarti 2fd8940c02 Allow array arguments to various methods that take ThemeStates 2014-03-01 23:11:24 -08:00
Saikat Chakrabarti 7408710761 Move placement of CPThemeStates cache to above the cache method for clarity. 2014-02-28 11:14:46 -08:00
Saikat Chakrabarti 745ad7cc34 Clean up the interface a bit to consolidate ThemeState methods onto one object. Keep CPThemeState as just a helper function. 2014-02-26 13:11:43 -08:00
Saikat Chakrabarti df148e4946 Fix a small typo in CPTheme.j themestate caching 2014-02-21 14:29:31 -08:00
Saikat Chakrabarti cf99a7bf18 Fix bug that was turning dictionary keys into objects 2014-02-20 18:14:01 -08:00
Saikat Chakrabarti 727b519750 Remove unused method in CPTheme 2014-02-20 18:09:47 -08:00
Saikat Chakrabarti 861d093d80 All ThemeStates always have at least one state - the normal state 2014-02-20 17:52:16 -08:00
Saikat Chakrabarti c3d2decdec Fix bugs with CPThemeAttribute encoding and decoding 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti d862d701f3 Add note to ThemeState object about it being private 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti 7eb35ef33d Clarify documentation for CPThemeState() 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti 1563b0bf55 Get all tests to pass 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti bad731c86f Fix subtracting theme states 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti 5309cc5916 Change CPTheme implementation to fix how searching for a matching theme works 2014-02-20 17:30:28 -08:00
Saikat Chakrabarti 9e61991ad2 Fix bug when setting themeStates in a themeAttribute 2014-02-20 17:30:27 -08:00
Saikat Chakrabarti c644e8a30f Change CPTheme to be hash-backed to make it a bit faster 2014-02-20 17:30:27 -08:00
Saikat Chakrabarti 45a237af16 Handle null inputs for subtracting CPThemes. 2014-02-20 17:30:27 -08:00
Saikat Chakrabarti 7d304fbd51 First round of changes to change theming system to use arrays and not bitmasks as their underlying datatype 2014-02-20 17:30:27 -08:00
Aparajita Fishman b198fee11a Fixed: default class theme value could be CPNull.
The class method +themeAttributes returns a dictionary, so CPNull has to be used instead of nil. Previously, if the class theme attribute was used, there was no attempt to convert CPNull to nil, which could have unintended consequences.
2013-03-15 10:02:31 -04:00
Aparajita Fishman d25ff21030 Fixed: _CPThemeAttribute _parentAttribute had confusing name
Previously _CPThemeAttribute had an ivar called _parentAttribute, which represented the attribute from the theme descriptor, as opposed to the attribute for a particular instance of a view.

This commit renames that ivar to _themeDefaultAttribute, so it is clearer where it gets its values.
2013-03-14 23:57:39 -04:00
Aparajita Fishman 6dc9aa815a Fixed: eliminated duplicate CPThemeStateSelectedTableDataView state
CPThemeStateSelectedTableDataView and CPThemeStateSelectedDataView were the same, and were not used in any consistent or meaningful way.

This commit eliminates CPThemeStateSelectedTableDataView, only CPThemeStateSelectedDataView is used now.
2013-03-14 17:06:23 -04:00
Alexander Ljungberg 5b05dc92a1 More dictionary literals. 2013-02-25 18:27:44 +00:00
Alexander Ljungberg 8bcbeb0aa9 Improve code readability with dictionary literals. 2013-02-25 17:02:36 +00:00
Alexander Ljungberg 9dbfa99284 Lint. 2013-01-20 17:14:44 +00:00
Martin Carlberg 458fa9d02e Fixed a lot of small bugs found by new warning message from compiler 2013-01-18 14:24:37 +01:00
Martin Carlberg c297e926f9 Compiler now works with jake and can compiler the whole Cappuccino framework. A lot of test cases still fail 2012-12-16 17:38:47 +01:00
Alexander Ljungberg 9f59ac96dd Inactive window title, start on window theming support.
Now the key window can be recognised by the window title.
2012-08-15 01:03:08 +01:00
Alexander Ljungberg b166995327 Move autocomplete into reusable class. 2012-06-16 12:31:48 +01:00
Aparajita Fishman e2ead56256 Collection KVC fixes, nextObject correctness
- Moved common CPArray/CPSet collection KVC operators to _CPCollectionKVCOperators.
- Implemented KVC operator dispatch using Objective-J.
- Fixed infinite loop with empty  collection in @min, @max and @sum operators.
- Correctly return valueForUndefinedKey when necessary.
- valueForUndefinedKey reason uses raw description for consistency, class' overridden description may not helpful at all.
- Don't create a forwarder for @ operators with property paths.
- Fixed CPSet -valueForKeyPath to correctly deal with nil/undefined/empty values.
- Added tests for collection  KVC operators.
- enumerator -nextObject should always compare against nil for clarity, correctness, and consistency.
2012-04-03 22:16:55 -07:00
Antoine Mercadal d7971322cb Merge pull request #1291 from miLibris/CPTheme-coding-fixes
_CPThemeAttribute fix : encode missing _defaultTheme value
2012-01-06 07:21:09 -08:00
Aparajita Fishman 1c2a304ee5 Assignment of function is a statement and should be semicolon terminated. Some miscellaneous linting as well. 2012-01-05 17:51:37 -10:00
Luc Vauvillier 6fe49fbf8d _CPThemeAttribute fix : encode missing _defaultTheme value 2011-06-01 17:02:01 +02:00
Klaas Pieter Annema c87cb4bacd properly fix CPThemeStateNormal behavior
- revert the previous fix
- explicitly check for CPThemeStateNormal in hasThemeState:
- update the test case
2011-01-05 12:30:14 +01:00
Klaas Pieter Annema b6ea6530b7 hasThemeState: always returned no for normal state 2011-01-05 10:44:50 +01:00