Commit Graph
262 Commits
Author SHA1 Message Date
Aparajita Fishman 932b825818 Merge pull request #2395 from didierkorthoudt/CPTrackingArea
Implementation of CPTrackingArea
2015-12-21 15:23:51 -08:00
Didier Korthoudt d7426f6d35 Several fixes 2015-12-19 21:56:27 +01:00
Didier Korthoudt 08d4e19851 various-fixes
Following @aparajita indications
2015-12-07 14:58:42 +01:00
Didier Korthoudt dcc0768411 Unit-test+fix 2015-12-05 20:14:24 +01:00
Didier Korthoudt f14062c721 Style-fixes 2015-12-03 20:44:34 +01:00
Didier Korthoudt a649a6ebac CIB-fix
For some (yet unknown) reason, when declaring a view with tracking area
in a CIB, there’s some weird things happening that try to use the
_trackingAreas array when it’s not yet initialized… So, replacing
_trackingAreas.length by [_trackingAreas count] resolves the problem.
2015-12-02 00:03:59 +01:00
Didier Korthoudt f3709a41e3 removeAllTrackingAreas 2015-12-01 21:06:55 +01:00
Didier Korthoudt 2f983fc305 optimization 2015-11-29 15:37:33 +01:00
Didier Korthoudt 924b994df2 First updateTrackingAreas implementation 2015-11-21 17:25:43 +01:00
Didier Korthoudt e1daf9467c Code-style-fixes 2015-11-19 06:13:18 +01:00
Didier Korthoudt 8d058a53fd CursorUpdate management + various fixes 2015-11-08 12:06:13 +01:00
Didier Korthoudt d864ae9fef Code style 2015-11-07 07:07:14 +01:00
Didier Korthoudt f1eeb61264 Fix: log traces removal 2015-11-06 15:05:34 +01:00
Didier Korthoudt 1418dd8b29 First submit for CPTrackingArea 2015-11-06 14:09:23 +01:00
Martin Carlberg fc411c5c1c Fixed: Cache ThemeAttribute
Conflicts:
	AppKit/CPTheme.j
2015-10-23 10:18:03 +02:00
Alexandre Wilhelm f062fda2f7 Fixed: optimization with layoutSubviews and viewWillLayout 2015-10-06 14:41:01 -07:00
Alexandre Wilhelm 1fe1e6f265 Merge pull request #2374 from Dogild/ThemeForObject
New: possibility to create a theme for every object of the Appkit
2015-10-02 10:35:02 -07:00
Alexandre Wilhelm 860decdac5 Fixed: CPColor and CPView implemented the category CPTheme 2015-10-02 10:12:50 -07:00
Alexandre Wilhelm 36cdcbc3c1 Fixed: setupViewFlags was not called when creating a view from a xib
Previously, the method setupViewFlags was not called when creating from a xib. This issue was introduced by the commit #448c2a2

Fixed #2380
2015-09-28 11:37:37 -07:00
Alexandre Wilhelm f2f4fa1b98 Fixed: readded _viewClassFlags. We only displayRect the view if drawRect: or viewWillDraw is implemented. layoutSubviews is still called even if the subclass does not implement it 2015-09-23 15:00:40 -07:00
Alexandre Wilhelm 6f43a189c0 Merge remote-tracking branch 'origin' into AppearanceCrash 2015-09-23 14:44:06 -07:00
Alexandre Wilhelm c9e83e0517 Merge pull request #2362 from cacaodev/cpview-skip_settransform
FIXED: In CPView, the transformation matrix was set at each drawing pass, even if the matrix was the identity matrix.
2015-09-22 17:02:30 -07:00
Alexandre Wilhelm b30103c790 New: added methods viewWillLayout and viewDidLayout
Previously, when a view was about to layout, only layoutSubviews was called. Now the methods viewWillLayout and viewDidLayout are called as well. This is like in Cocoa.

This PR fixed the issue with the appearance and the view based tableView. We now handle everything related with appearance when making the layout of a view.

This PR removed a small optimization in CPView. Now when making setNeedsLayout and setNeedsDisplay, the methods drawRect: and layoutSubviews are always called even if there are not override. (As in cocoa)
2015-08-28 11:11:28 -07:00
Alexandre Wilhelm 42c3c7bc48 Fixed: crash when using a viewBased CPTableView with appearance
Previously, when using a viewBased CPTableView Cappuccino just crashed.
This was due to the new appearance feature. Indeed, at the end of the method initWithCoder: of CPView, we set the appearance of the current view and the themeStates of the view and its subviews. For an unknown reason some of these subviews were not completely initialized (see comment line 3742), this made crashed cappuccino because _themeState was null.

To fix this issue, we send the method setAppearance when the current stack was performed. (Magic setTimeout...).

This is for sure not the ultimate best fix, but it's prevent to have a broken master. We will need in the future to fix this issue in a better way.
2015-08-25 16:46:00 -07: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
Alexandre Wilhelm 2f79b079fd New: default menu system is now disable for every right click except for the CPTextField
Previously, when making a right click and when a cappuccino menu was not displayed, the system menu was displayed. Now we don't display this menu anymore as in cocoa. We only display when making a right click on a CPTextField.
2015-08-20 16:14:14 -07:00
Antoine Mercadal 7e4e1ec68f FIXED: lot's of error with CPAppearance 2015-08-14 01:44:22 -07:00
Antoine Mercadal 541a7974e0 NEW: effectiveAppearance and new CPThemeState
Each default (and only supported) CPAppearance now have an associated
theme state. As the appearance is correctly propagated in CPViews
hierarchy, it is now possible to have dark controls when the an
ancestor view has a dark appearance.

Added automated tests
2015-08-13 23:40:27 -07:00
Antoine Mercadal 6d67d30aee NEW: Initial support for CPAppearance
This patch adds the `CPAppearance` class and uses it where needed.
There is nearly no impact, but in `_CPPopoverWindowView` where the
`CPPopoverAppearance` needs to be converted to a `CPAppearance` object

nib2cib support has also been added.

*This patch brings no new functionality.*
2015-08-13 19:56:10 -07:00
cacaodev 0a20f77b08 FIXED: In CPView, the transformation matrix was set at each drawing pass, even if the matrix was the identity matrix.
Now we check if the highDPI ratio is == 1 and skip the setTransform call in this case.
2015-06-13 21:06:17 +02:00
Alexandre Wilhelm 44c686f494 Merge pull request #2323 from mrcarlberg/scroll_rect_to_visible_with_large_rect
Fixed: Method scrollRectToVisible:(CGRect)aRect in CPView didn’t work...
2015-04-13 13:12:27 -07:00
Martin Carlberg b3dfce7b5a Fixed: Compared the rects minimum x value with it self instead of the visible minimum x value. Also fixed the test case to catch this. 2015-03-31 17:30:57 +02:00
Antoine Mercadal 027a317291 FIXED: Memory Leak with tooltips
Only populate the tooltips handler functions when necessary (when there is a tooltip and when the view is in a window) or clear them otherwise.

Tests in /Tests/AppKit/CPViewTest.j
2015-03-05 16:59:37 -08:00
Martin Carlberg 8e497e2a48 Fixed: Method scrollRectToVisible:(CGRect)aRect in CPView didn’t work correctly if aRect is larger then the visible rect.
If aRect is larger then the visible rect this method scrolled all they way to the opposite edge instead of the nearest.
2015-03-02 16:30:02 +01:00
Alexandre Wilhelm bb64d0dd54 New: added method needsLayout in CPView 2015-02-20 15:49:08 -08:00
Alexandre Wilhelm f82b478a77 New: added the method setNeedsLayout:
This PR adds the possibility to layout or not a CPView.
Previously, once setNeedsLayout was called on a CPView, it wasn't possible to cancel the layout of the view.
Now we can as in cocoa. The method setNeedsLayout will still work (it calls the method setNeedsLayout: with YES).

UnitTests in Tests/AppKit/CPViewTest.j
2015-02-20 14:36:27 -08:00
Alexandre Wilhelm d546da8b5f Fixed: issue with scaling a view. The associated canvas now upadtes its size when having a zoom 2015-02-12 12:49:18 -08:00
Alexandre Wilhelm e53658759b Merge remote-tracking branch 'origin' into RetinaDisplayed 2015-02-09 18:03:29 -08:00
Andrew Hankinson f03adf727b Fixed: Inconsistent naming of CPDOMDisplayServerSetStyleBackgroundSize
Previously the method `CPDOMDisplayServerSetStyleBackgroundSize` was named `CPDomDisplayServerSetStyleBackgroundSize`, which was inconsistent with the names of all other similar methods in the CPDOMDisplayServer.h file. This commit fixes this and updates all instances of its use in CPView.j.
2015-01-15 13:59:19 -05:00
Alexandre Wilhelm 6ed7354884 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2014-11-26 15:57:40 -08:00
Alexandre Wilhelm 547522a0a4 Fixed: Memory leak in CPClipView
Previously, the CPClipView registered the documentView to the notificationCenter as an observer to be notified when the frame/bounds of the  documentView change.

Now, we don't use the notificationCenter anymore. The class CPView send a message to its superview (when it's a clipView) when the frame or bounds change. This fix the memory leak of the CPClipView

Fixed #2264
2014-11-26 13:06:03 -08: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
Alexandre Wilhelm 921fcbdcd0 Fixed: firstResponder is lost when adding a firstResponder view to the same window
Previously, when adding a view (which is the firstResponder of the window) to the same window, the firstResponder was set to nil.
Now it keeps the same firstResponder.
2014-09-29 19:19:17 -07:00
Alexandre Wilhelm 93743b11b2 Fixed: typo in documentation in CPView.j 2014-09-22 10:13:51 -07:00
Alexandre Wilhelm a94696e037 Fixed: refactoring of the retina drawing feature 2014-09-21 22:46:46 -07:00
Alexandre Wilhelm 0255e8980b Fixed: remove stupid debug mode 2014-09-21 22:38:11 -07:00
Alexandre Wilhelm eff9c69069 Fixed: transform matrix for retina displayed is reset when changing the frame of the view 2014-09-21 22:35:50 -07:00
Alexandre Wilhelm 79ef6f2f75 Fixed: dpi drawing didn't work when changing the frame of a view 2014-09-17 13:35:07 -07:00
Alexandre Wilhelm 451ac297d4 Fixed: change accessors for CPViewHighDPIDrawingEnabled 2014-09-17 10:52:22 -07:00
Alexandre Wilhelm 0fd8a4507c New: possibility to draw automatically in high DPI in canvas2D
Previously, Cappuccino didn't handle retina device when drawing for canvas2D. Now it does.
To do that, Cappuccino will firstly calculate the pixel ratio of the current device, then it needs to change the css style of the canvas by multiply it by the current pixel ratio and finally scale the canvas by this pixel ratio.

More information about high DPI drawing here : http://www.html5rocks.com/en/tutorials/canvas/hidpi/

Added the method `setAllowsHighDPIDrawing:` and `allowsHighDPIDrawing` to deactivate or activate this feature.

Fixed #2175
2014-09-17 10:27:26 -07:00