Commit Graph
4904 Commits
Author SHA1 Message Date
Didier Korthoudt 76ab5fbf78 CPControl-fix 2015-11-30 09:07:33 +01:00
Didier Korthoudt c0b0c74638 CPTableHeaderView-fix 2015-11-30 05:49:11 +01:00
Didier Korthoudt 6c0b771758 CPSplitView-fix 2015-11-29 21:54:36 +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 b10de5e82c Code-refactoring 2015-11-21 09:20:28 +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
Antoine Mercadal d5f38fe2f2 Merge pull request #2392 from Dogild/RunLoopBlock
New: added the method performBlock in CPRunLoop
2015-10-27 17:36:22 -07:00
Alexandre Wilhelm d4b1680727 Fixed: new CPPLatformWindow did not have a platformPasteboard. copy and paste did not work for other platformWindow except the main one 2015-10-27 12:08:10 -07:00
Alexandre Wilhelm 4d1dc0c949 New: added the method performBlock in CPRunLoop
Previously, we could only give a selector and a target for perform in the runLoop. Now we can give a block.
This feature is used in the CPTextField class. Previously, when we wanted to call a function at the end of the stack we used window.setTimeout, however due to HTML5 specifications this wasn't called just at the end of the stack but at least 4ms (more information here https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout#Minimum_delay_and_timeout_nesting). Now we give a block to perform, and this block will be performed in the next runloop.

Unittest has been added in Tests/Foundation/CPRunLoopTest.j
2015-10-26 15:36:13 -07:00
Aparajita Fishman 526181a76b Fixed: CPImage -size returned internal object ref
Previously, CPImage -size returned a reference to the internal _size object, which allowed the caller to directly change _size. In Cocoa a copy of the size is returned.

This commit returns a copy of _size to ensure no unwanted side effects.
2015-10-16 16:20:24 -04:00
Alexandre Wilhelm f062fda2f7 Fixed: optimization with layoutSubviews and viewWillLayout 2015-10-06 14:41:01 -07:00
Alexandre Wilhelm f8eab7d611 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2015-10-02 16:03:04 -07:00
Alexandre Wilhelm 40a9f19352 Fixed: crash when opening a platformWindow with a popup blocker
Previously, when opening a CPPlatformWindow a crash happened when this new window was blocked by the browser (addblock, or browser feature).
Now when opening an external window, we check if the DOMWindow has been created.

This PR has modified the method isVisible of CPPlatformWindow. We now check if the _DOMWindow is not NULL and undefined.
2015-10-02 16:00:57 -07:00
Martin Carlberg 4b81e0d8af Merge pull request #2383 from mrcarlberg/use_more_fast_objj__msg_send
Use the faster objj_msgSend instead of the old slower objj_msgSend
2015-10-02 20:35:32 +02:00
Alexandre Wilhelm ea37bf8b45 Merge branch 'master' of https://github.com/cappuccino/cappuccino 2015-10-02 11:10:01 -07:00
Alexandre Wilhelm c30f8b09b0 Fixed: warning when compiling in CPWindow, CPPanel and _CPCibKeyedUnarchiver 2015-10-02 11:09:48 -07:00
Alexandre Wilhelm 686f931fb4 Merge pull request #2343 from Dogild/Localization
New: first work on localization
2015-10-02 11:04:35 -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
Martin Carlberg e5e50c2220 Fixed: Use the faster objj_msgSend instead of the old slower objj_msgSend
In some places the objj_msgSend function is called directly. Most of the times the old slower version is called. This commit will use the never faster version instead.
2015-10-01 22:17:13 +02:00
Alexandre Wilhelm c8d768c59a New: added protocol CPTheme 2015-09-29 12:54:32 -07:00
cacaodev 3ef1c9167f Merge remote-tracking branch 'upstream/master' into CPTabView
Conflicts:
	AppKit/CPTabView.j
2015-09-29 11:04:51 +02: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 4ac63950ad Fixed: toolTip does not work on a external window
Previously, the toolTip created for an external window where shown on the primary platform window. We now display it on the desired platformWindow.
2015-09-22 15:58:53 -07:00
Alexandre Wilhelm 7a0b2c958b Fixed: crash with CPRuleEditor when dragging the first row
Previously, cappuccinos crashed when dragging to the top the first row of a CPRuleEditor.
2015-09-22 15:01:19 -07:00
Alexandre Wilhelm 3fcc37e086 Fixed: CPTabView did not accept first mouse event
Previously, the CPTabView did not react with the first mouse event (for instance when a CPTabView was in a not focused window). Now it does as in cocoa.

To do that, the CPTavView override the method acceptsFirstMouse. Previously, the tabView had a CPBox, it now has a _CPTabViewBox. This new box reacts differently than the CPBox for the method hitTests. It now returns nil when the click was performed on the segmentedControl of the CPTabView, previously this same click would be handle byt the CPBox.
2015-09-22 14:33:14 -07:00
cacaodev 41d259006e Merge remote-tracking branch 'upstream/master' into CPTabView 2015-09-14 18:57:12 +02: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 bb9408b5d0 Merge branch 'master' into Localization 2015-08-27 15:16:12 -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 464040895c Fixed: remove log... 2015-08-21 16:06:25 -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
Alexandre Wilhelm 655bc39d85 Fixed: blinking popover animation on Chrome and Opera
Previously, when opening a popover, the animation was blinking on Chrome and Opera.
To resolve (temporary I hope) this issue, we launch the last part of the animation at the beginning of the next runloop. We do that by wrapping the desired code in window.setTimeout(function(){},0).

A google chrome issue has been opened here : https://code.google.com/p/chromium/issues/detail?id=523044&thanks=523044&ts=1440095724
2015-08-20 11:36:57 -07:00
Antoine Mercadal 7e4e1ec68f FIXED: lot's of error with CPAppearance 2015-08-14 01:44:22 -07:00
Antoine Mercadal 547764e3c1 FIXED: Always call [super awakeFromCib] in CPView subclasses 2015-08-14 01:43:55 -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 6bf6f82cad Small refactoring 2015-08-13 21:29:33 -07:00
Antoine Mercadal 7be2325a95 Fix few mistakes 2015-08-13 21:12:04 -07:00
Antoine Mercadal fa1f739458 NEW: Support for basic CPVisualEffectView
This patch contains a very naive implementation of the
NSVisualEffectView. This will only work on very recent unreleased
version of Safari, but should be supported by all at some point. This
allow to use the Yosemite/iOS blurry effect.

Not all options are supported (especially the
`CPVisualEffectBlendingModeBehindWindow` mode…). But hey! it’s a start
:)

Tests in Manual/CPVisualEffectViewTest
2015-08-13 20:53:53 -07:00
Antoine Mercadal 20289ff81b fix two small bugs in CPApperance 2015-08-13 20:25:45 -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