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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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
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
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
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.
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
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
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.
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.
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.
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.
-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
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.
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.
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.
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.