Commit Graph
4192 Commits
Author SHA1 Message Date
Andrew Hankinson bcfaf3a37e Fix Pulldown Button disabled images
The new images are set at full opacity with the blue highlight colour removed
2013-03-26 17:43:02 -04:00
Andrew Hankinson b1c45e579a Fix CPPopupButton disabled images
The new images are set at full opacity with the blue highlight colour removed
2013-03-26 17:42:41 -04:00
Andrew Hankinson e627f60b16 Fix CPComboBox disabled images
The new images are set at full opacity with the blue highlight colour removed
2013-03-26 17:42:05 -04:00
Andrew Hankinson a368fe5825 Fix disabled theme for Aristo2 segmented controls
Disabled state is now set via CSS opacity alone
2013-03-26 13:39:46 -04:00
Andrew Hankinson 895a128ff7 Fix disabled theme for Aristo2 radio buttons
Disabled state is now set via CSS opacity alone
2013-03-26 13:33:55 -04:00
Andrew Hankinson 4d828a01aa Fix disabled theme for Aristo2 checkboxes
Previously the Aristo2 checkboxes used dedicated images for disabled controls.

This commit removes the disabled controls and allows the disabled state to be set via CSS opacity on the "regular" checkbox controls.
2013-03-26 13:29:48 -04:00
Kjell Nilsson d9e7912162 Fixed: constructing a 'RowCountChanged' notification generates a nil warning when dragging a row
Previously, when

- Dragging a row in the rule editor

would eventually try to generate a dictionary with key 'indexes' and a
nil value in the method __postRowCountChangedNotificationOfType:indexes:.
Generating an empty dictionary instead when there is no indexes solves
this issue.
2013-03-26 11:19:44 +01:00
Aparajita Fishman b26542136e Formatting 2013-03-25 15:59:10 -04:00
Christophe Serafin c135905e64 removed blank line and console messages 2013-03-25 13:37:49 +01:00
Christophe Serafin b7b7d33597 avoid to call the delegate when moving before the first column and after the last column 2013-03-25 13:22:43 +01:00
Aparajita Fishman 097d8e9b97 Fixed: adding object to CPArrayController generated warning.
Previously, if properties were bound to table columns in a cell-based table, and an object was added/inserted using CPArrayController, a warning was generated about a missing observer.

This commit is a temporary fix, the real fix is to implement more granular notifications during didChangeValueForKey:, which will eliminate the source of this problem.

Fixes #1781.
2013-03-24 20:12:22 -04:00
Aparajita Fishman 8c811ba9ca Fixed: instantiating a cib with no owner would generate nil warning
Previously, when a view-based table:

- Had no delegate.
- Used bindings for its data source, thus obviating the need for makeViewWithIdentifier:owner:.

it would eventually call CPCib -instantiateCibWithOwner:topLevelObjects: with a nil owner (the nil table delegate). This method would try to construct a dictionary with the nil owner, which would generate a deprecation warning, and will in the future fail altogether.

In Cocoa, this is exactly what happens, the owner is nil. And the documentation for -instantiateNibWithOwner:topLevelObjects: clearly states that the owner may be nil.

This commit only adds the owner to the name table dictionary if the owner is non-nil. Since objectForKey: with a non-existent key returns nil, this is the same as storing nil for that key.
2013-03-24 19:46:53 -04:00
Alexander Ljungberg b6cf557483 Merge pull request #1879 from cacaodev/CPDragServer-fixed-constrained-inside-bounds
Fixed: A dragged view was constrained inside a plaform window bounds.
2013-03-24 22:20:42 +00:00
cacaodev 07222e92c2 Fixed: A dragged view was constrained inside a plaform window bounds.
For example, in CPTableView before this change, dragged rows could not move up if the table view was near the top of the platform window.

Fixes #1877
Test TableTest/ViewBasedCib/ and drag up the third row.
2013-03-24 22:08:15 +01:00
Andrew Hankinson 011c3c9c5b Fixed: Typo in CPImageView Category
The category name for CPImage (CachedImage) was spelled wrong. This commit fixes the typo.
2013-03-24 16:15:50 -04:00
cacaodev a9ec90713e The FR can be a window, don't check if it's inside a table. 2013-03-24 20:33:22 +01:00
cacaodev 8663b7b3fa Merge remote-tracking branch 'upstream/master' into CPTableView-viewForRow-infinite-loop 2013-03-24 18:50:41 +01:00
cacaodev 3ef5cfe846 Fixed: Infinite loop when a first responder has a nil superview
This bug appears only if a table view have been added to the window.

CPTableView observes first responder changes and moves up in the view
hierarchy to determine the edited data view. If for some reason, a
superview in the hierarchy was nil, we entered an infinite loop.

This commit adds guards to the recursive method that searches the data
view. Also added an early return when the fr changes to a view outside
the table.

Fixes #1875
2013-03-24 18:37:12 +01:00
Andrew Hankinson 0013375eea Docs: Out of date documentation for CPTableView
A small documentation change to reflect the updated viewForTableColumn:row:
2013-03-21 16:24:55 -04:00
Blair Duncan 5868a4cefb added missing methods to CPDocumentController
documentForWindow
hasEditedDocuments

both are in cocoa
2013-03-21 11:15:25 -04:00
Blair Duncan 3178f0b57d Fixed CPDocumentController missing method currentDocument
In this commit I've added the currentDocument method to the document controller

Also removed the firstEligibleExistingWindowController method from CPDocument
It did nothing but add confusion as it was not used anywhere else in the frameworks.
And it is not in cocoa.
2013-03-21 10:38:06 -04:00
Alexander Ljungberg 31c06771f3 Fixed: CPBezierPath getLineDash:phase: typo. 2013-03-21 14:37:37 +00:00
Alexander Ljungberg da9333e884 Fixed: CPBezierPath getLineDash: nil arguments, setLineDash:count:phase: argument style.
Previously, passing nil to the first or last argument of getLineDash:count:phase: would cause a crash.

With this change, these references are simply not written to if nil.

Previously, setLineDash:count:phase: took references for its arguments to match getLineDash:count:phase:. This was however wrong and is not what is done in Cocoa.

This fix makes the setLineDash:count:phase: calling convention the same as in Cocoa.
2013-03-20 16:02:27 +00:00
Alexander Ljungberg af11431b09 Fixed: Firefox dashed stroke phase support (theoretically).
This fix should in theory make the phase argument work in Firefox, although in Firefox 19.0.2 it doesn't seem to work. Hopefully it'll kick in in a future version of Firefox.
2013-03-20 15:42:22 +00:00
Alexander Ljungberg ffbd9815d5 New: CPBezierPath setLineDash: and getLineDash:.
Also includes Cocoa compatible methods for completeness.
2013-03-20 15:26:51 +00:00
Alexander Ljungberg ab692bb15d New: CGContextSetLineDash. 2013-03-20 14:06:01 +00:00
Aparajita Fishman 5d2e4bf7cc Fixed: theme build failed
Previously CPTableView -_init was trying to reference a theme value, but that doesn't work because the theme creates a CPTableView and during that _init the theme value is not yet defined.

This commit uses lazy instantiation to avoid this problem.

Also, column selection was added to the CPDictionaryControllerTest to better visualize unfocused selection highlight colors.
2013-03-18 08:21:02 -04:00
Aparajita Fishman a4fb2deece Fixed: unfocused selection highlight colors were hard coded
Previously, the colors used for unfocused selection highlighting were hard coded. In Cocoa, they seem to be desaturations of the focused selection highlight colors.

This commit calculates the unfocused highlight colors from the focused colors.

It also removes some dangling commas.
2013-03-17 18:29:47 -04:00
Aparajita Fishman afc2c17b5a Fixed: highlighted table cells with CPTableViewSelectionHighlightStyleNone had white text.
Previously, CPTableView was unconditionally setting the selected theme state for selected data views. When the selection highlight style is CPTableViewSelectionHighlightStyleNone, there is no row selection highlighting done. Since the default theme specifies white text for selected data views, we ended up with white text on a non-highlighted background, which was invisible on non-alternate rows and almost invisible on alternate rows.

This commit unsets the selected theme state flag for any redrawn data views when the selection highlight style is CPTableViewSelectionHighlightStyleNone, thus the text color does change at all when selected.

Fixes #1847
2013-03-16 15:41:24 -04:00
Blair DuncanandAparajita Fishman efdf0a6b84 Fixed: When editing a table cell, the row lost focus.
Previously, when a table cell was edited, the table thought it had lost focus and displayed the cell's row highlight in an unfocused state.

This fix updates the _isFocused test to include tests for cell editing in both cell-based and view-based tables.
2013-03-16 09:33:53 -04:00
Aparajita Fishman b36f8d794c Fixed: unfocused selection highlight in table upside down.
Previously the gradient in an unfocused selection highlight in CPTableViewSelectionHighlightStyleSourceList style was darker at the top and brighter at the bottom, which is the opposite direction of the gradient when focused.

This commit makes all of the unfocused highlight colors a strict 5% desaturation of the focused colors.

Refs #1839
2013-03-15 19:57:20 -04:00
Aparajita Fishman 5c022f86ea Fixed: table selection highlight gradient top/bottom too dark.
In CPTableViewSelectionHighlightStyleSourceList selection style, a table view draws the highlight on each row with a top line, linear gradient, and bottom line. Previously, the top and bottom lines were quite dark in relation to the gradient.

This commit makes the top and bottom line brighter, to make the transition to the gradient more subtle.

Refs #1839
2013-03-15 19:57:19 -04:00
Blair DuncanandAparajita Fishman fd20a8045e Fixed: table view selection color did not change when losing focus.
CPTableView has no focus ring, and currently gives no visual feedback of its firstResponder status. In Cocoa when the table view resigns firstResponder or its window loses key status, the selection color turns gray.

This commit sets the selection color to gray when a table view resign firstResponder or its window loses key status. A second window and a couple of textfields were added to the CPDictionaryControllerTest to demonstrate the changes.

Fixes #1839
2013-03-15 19:56:47 -04:00
Aparajita Fishman 9482d14160 Fixed: table view highlight update loop had high overhead
Previously the selection highlight update loop created two selectors and called an extra method for every row being updated.

The selectors are now calculated beforehand, and the method call has been eliminated.
2013-03-15 16:37:15 -04:00
Aparajita Fishman 61783021cc Fixed: default horizontal margin wasn't changed along with theme value 2013-03-15 13:30:26 -04:00
Andrew HankinsonandAparajita Fishman 64b5299c0d Fixed: menus were too far apart.
Previously the main menus were farther apart than the Aristo 2 PSD indicated, and too far apart visually.

This commit reduces the horizontal margin between menu items that have originated from Interface Builder. A value of 9.0 for horizontal margin (down from 12.0) reduces the margin on both sides of the menu by 3px, reducing the inter-menu spacing by a total of 6px.

Fixes #1809
2013-03-15 12:55:03 -04:00
Blair DuncanandAparajita Fishman 8d2077fc5d Fixed: views from other windows could be set as next/previous key view.
Previously, no check was done to ensure a next/previous key view belonged to the same window as the view to which it was being chained. This could lead to an infinite loop.

This commit will only set the next/previous key view if the proposed's views window is either nil or is the same as the receiver's window.

Closes pull request #1851
2013-03-15 12:39:08 -04:00
Alexander Ljungberg 720b61f4f6 New: close pull down menu on second click on its button.
Previously, if a pull down menu was brought down from a pop up button in pull down mode, clicking the button again would close and reopen the menu.

With this fix the behaviour becomes like in Cocoa, and clicking the button a second time simply closes the menu.
2013-03-15 14:47:16 +00:00
Alexander Ljungberg 9fa8867495 Fixed: infinite loop clicking on a pull down menu button.
This was caused by the menu opening up below the button. When the menu manager examined this event it saw a click outside of the menu and immediately closed the just opened menu. Then it put the opening event back on the event queue, causing the pop up button to try to open its menu again.

The fix ignores the opening event for purposes of detecting clicks which should close the menu.

Refs #1833.
2013-03-15 14:47:16 +00: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
cacaodevandAparajita Fishman 33858cfc3b Fixed: incorrect table column highlighting and row selection after column sort.
Previously in CPTableView, after clicking a sortable column, data views of the sorted column ended up in a selected state and a row was selected instead of the sorted column. As a result, the text of the rows would turn white as if they were selected, but there was no highlight, so the text was basically invisible.

This commit fixes that by reversing the order of operations when clicking a column. First the sort is done, then the selection.

Fixes #1337, #1688, #1779.
2013-03-15 08:26:37 -04:00
cacaodevandAparajita Fishman 7225e7e038 New: deprecate -tableView:dataViewForTableColumn:row: and -outlineView:dataViewForTableColumn:item:
-tableView:dataViewForTableColumn:row: and -outlineView:dataViewForTableColumn:item: are deprecated in favor of ...viewForTableColumn:...

Using the previous delegate API and not caching the view with an identifier was degrading performance. With this change, developers are encouraged to use the new caching system and the CPTableView method -makeViewWithIdentifier:owner: to get the view.

Also fixed a condition where a view-based outline view was not always asking for the view from its delegate. In some circumstances, an outline view could be considered as view-based instead of cell-based.

Test for deprecated delegate methods in CPOutlineViewViewBasedCib and TableTest/ViewBased examples.

Fixes #1823
2013-03-15 08:16:02 -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 9827f19c63 Fixed: selected table used bold font, text was fixed size
It used to be part of the theme to make the text in selected table rows bold. I never quite understood that, it really isn't necessary visually. Cocoa doesn't do it, I don't know of any toolkit that does.

Also, fixed sizes were used for text field theme fonts, which did not allow them to track runtime changes to the system font size.

This commit makes selected table row text plain, so selecting a row does not change the metrics of the text, just changes the color, which is much more pleasing visually.

Also, the special CPFontCurrentSystemSize constant, which tracks the actual font size at runtime, is used for text field font sizes.
2013-03-14 23:51:54 -04:00
Aparajita Fishman edb1a68952 Formatting 2013-03-14 23:49:14 -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
Aparajita Fishman bf36c40f88 Fixed: optimized selector creation
Use @selector, that happens at compile time, instead of CPSelectorFromString, which happens at runtime.
2013-03-14 17:06:23 -04:00
Alexander LjungbergandAntoine Mercadal cd620b0c5a Fixed: more precise array controller insert index test.
Refs #1856.
2013-03-14 13:49:42 -07:00
Blair DuncanandAntoine Mercadal 009ae1e14c Fixed ArrayController failed to recognize row 0 as the insert location
The logic is wrong in the test for last selection since it can be 0
and if there is no selection, [_selectionIndexes lastIndex] returns -1

Fixes #1723
2013-03-14 13:49:42 -07:00
cacaodev c8b812bbb5 FIXED: A data view edited in a table view was duplicated after a reload.
Previously in CPTableTView, a view being edited was not cached when unloaded, for example when made invisible after scrolling or when calling -reloadData.
This situation was causing a duplicated view to be added at the same place when the data view was loaded again.
After this commit, edited data views are cached and resign their first responder status just before they are added to the queue because they can be reused at another place.

Test: Added a "reload data" button in ViewBasedCib example.
2013-03-14 19:28:45 +01:00