Commit Graph
252 Commits
Author SHA1 Message Date
Alexandre Wilhelm 46a0ce8e98 Fixed: wrong condition when setting the frame in CPWindow when ordering a view 2014-12-04 11:06:50 -08:00
Alexandre Wilhelm c3ce0a61b6 Fixed: type with the method _windowWillBeAddedToTheDOM in CPWindow 2014-12-02 10:03:13 -08:00
Alexandre Wilhelm f5d847f320 Style: style in CPWindow 2014-12-01 16:08:49 -08:00
Alexandre Wilhelm 1df0da7509 Fixed: method addObservers and removeObservers were not call all the time when ordering or not a window 2014-12-01 16:07:48 -08:00
Antoine Mercadal b0a7fe4079 Merge branch 'master' into objj-typedef-and-ivar-checks
+ fixed new warnings from master

Conflicts:
	Foundation/CPNotificationCenter.j
2014-11-26 12:00:34 -08:00
Antoine Mercadal 5a99e18d7c Merge pull request #2238 from Dogild/ChainSheetWindow
Fixed: unable to chain sheet in a window
2014-11-17 12:42:15 -08:00
Alexandre Wilhelm 664d5777fd Fixed: CPWindow doesn't take the event when moving from another platformWindow
Previously, when moving from platformWindow to another platformWindow, the targeted window didn't get the new event because the keyWindow of the application was still set to the other platformWindow.

This PR fixes another issue about opening panel in a platformWindow. When opening a panel in a platformWindow, cappuccino set the new key window to the wrong platformWindow.
2014-11-07 15:43:18 -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 bfd0ceac53 Typo: becauwe instead of because 2014-10-29 21:50:46 -07:00
Alexandre Wilhelm ba20936c17 Fixed: unable to chain sheet in a window
Previously when chaining sheet on the same window, Cappuccino crashed.
Now chaining a sheet in the delegate method of the method endSheet: will open the next sheet.

Now when opening a sheet, we check if another sheet is currently closing. If yes, we wait till we get the notification of the closing of the previous sheet. And then we open the next sheet.

Fixed #2159

Test app in Tests/Manual/AttachedSheet2/SheetWindowController.j
2014-10-29 15:04:55 -07:00
Alexandre Wilhelm fcd2b778ea Fixed: CPWindow keeps a reference of its firstResponder when closing a window
Previously, when closing a CPWindow, the window kept a reference of the firstResponder. This things raised an issue when opening a window again and asking the window to make the first responder to the same element as the one we had.

Now when closing a window, the window will update its firstResponder to nil.
2014-10-23 11:53:46 -07:00
Alexandre Wilhelm de495aa1c5 Fixed: _removeObservers called in orderFront, we don't need this as addObservers and removeObservers work with boolean to check if the observers are set or not 2014-08-28 22:28:41 -07:00
Alexandre Wilhelm 0479e9b3f3 Fixed: make sure to remove observers when opening a CPWindow 2014-08-19 17:52:24 -07:00
Alexandre Wilhelm abdf1156d4 Fixed: memory leaks with CPNotifications
Previously, when removing a view, Cappuccino didn't clean the notification center. The notification center kept in reference old views.

This PR fix this issue. When a CPView is added to a view, the methods _removeObservers and _addObservers are called. In these both methods we remove and add the observer to the notification center if needed. _removeObservers and _addObservers are called for the view and its subviews. These both methods are called through the method viewWillMoveToSuperview.

When a CPView is removed, we only call the method _removeObservers.
When a CPWindow is closed, we call the method _removeObservers on its contentView.
When a CPWindow is about to be opened, we call the method _removeObservers and _addObservers on its contentView.

Refs #1880
Refs #2024

Test app in Tests/Manual/AttachedSheet2/SheetWindowController.j
2014-08-19 17:45:01 -07:00
Alexandre Wilhelm c274f27810 Fixed: escape on a panel or popover breaks the key chain event
Previously when hitting escape on a CPPanel, the key chain event was broken.
Now when the user hit escape, cappuccino do the following process

- Check if the firstResponder or the chain of the nextResponder implement cancelOperation:
- If not, performKeyEquivalent on the firstResponder and so on
- If not, call the method cancel: on the firstResponder and the chain (not in the case of the CPPopover)

Previously, a complete: method was called if the user hit escape on a void window. This is not a feature of Cocoa, @apajarita or @aljunberg can you confirm that ?

This commit is related to the commit #2139
2014-06-25 18:08:26 -07:00
Antoine Mercadal f418f9de4c Merge pull request #2139 from Dogild/EscapePanel
Fixed: CPPanel and popover doesn't close when hitting escape
2014-06-24 17:45:27 -07:00
Alexandre Wilhelm 71c1369365 Fixed: removed uelsee import in CPWindow 2014-06-24 17:20:31 -07:00
Alexandre Wilhelm b015a6ea6c Fixed: refactoring of the escape feature of the panel and popover 2014-06-24 17:18:13 -07:00
Aparajita Fishman cf06686d67 Merge pull request #2101 from mockingbird/fix-cpwindow-setcontentview-check
Have CPWindow setContentView check that the new view is not the same as the existing content view
2014-06-22 14:29:36 -04:00
Alexandre Wilhelm 148f3172e6 Fixed: When closing a panel with escape, the delegates are not called
Previously, when closing a panel or popover with escape, the different delegates weren't called.
Now it does.
2014-06-18 18:58:08 -07:00
Alexandre Wilhelm ce86c757cd Fixed: missing bracket... 2014-06-18 16:39:26 -07:00
Alexandre Wilhelm cd6ffba9ac Fixed: CPPanel and popover doesn't close when hitting escape
Previously, a panel or a popover didn't close when the user hit the key escape.
Now it does. The panel or the popover will close on the keyDown event as in cocoa.

Test app in Tests/Manual/CPPanelTest/ and Tests/Manual/CPPopoverTests

Fixed #1767
2014-06-18 16:29:13 -07:00
Alexander Ljungberg 025a43ea4e New: CPThemeStateKeyWindow for CPView.
Every view in the key window now takes on the 'key window' theme state. This makes it easy to theme everything in inactive windows in more muted colours. Also, combined with the first responder theme state of the previous commit we can have visuals like "first responder but in an inactive window" for text views and such things.
2014-05-11 15:51:17 +01:00
Saikat Chakrabarti fa3f18c88b Have CPWindow setContentView check that the new view is not the same as the existing content view. 2014-04-02 22:56:22 -07:00
Alexandre Wilhelm 232cf69006 Fixed: wonrd params for the method _sendDelegateWindowWillReturnUndoManager 2014-03-27 19:54:15 -07:00
Alexandre Wilhelm 9d2fba308d New: Added CPWindowDelegate protocol
Added CPWindowDelegate protocol
Also, now, delegate methods are called as we are used to do it in Cappuccino
2014-03-27 19:52:06 -07:00
Alexander Ljungberg b4cabc97d1 Merge pull request #1974 from mrcarlberg/protocol
Protocol support for Objective-J
2013-11-28 17:18:16 +00:00
Martin Carlberg 8419001810 Merge branch 'master' of https://github.com/cappuccino/cappuccino into protocol 2013-11-22 14:23:52 +01:00
Alexandre Wilhelm e058d2e143 Fixed: when doubleClicking to open/close a sheet, issues with the parentWindow and the frameOrigin of the sheet
When opening a sheet, with a double click the frame origin of the sheet changed and the parent disappeared.
This PR fix this issue.

Test app in Tests/Manual/AttachedSheet/AppController.j
2013-11-21 17:42:43 -08:00
Aparajita Fishman 30441b109f Fixed: windows that were autoresized and not constrainable would obey the global CPWindowConstrainToScreen flag.
Previously, if a window had an autoresizingMask and was marked as not being constrained (for example _CPMenuBarWindow), and the CPWindowConstrainToScreen was set to NO, resizing the platform window would not autoresize the window.

This commit ensures that windows that autoresize but don't care about constraining will resize with the platform window no matter what.

Fixes #1981.
2013-08-23 18:28:40 -04:00
Antoine Mercadal f637931ba7 FIXED: Bug introduced with my previous commit, preventing popover to open in some cases.
Previously, addChildWindow:ordered: was setting the platform window of the child window.
This patch restore the correct behaviour, and fix a bug with _CPAutocompleteMenu. Now the autocomplete menu is opened as a child of its textfield window using the correct platform window.
2013-08-15 19:40:40 -07:00
Antoine Mercadal 1e7dd0dc59 FIXED: Bug that could open a child window in the wrong platform window
Previously, addChildWindow:ordered: did not set not the child window's platform window. This could result to open them in the wrong browser window. This patch makes sure to set the parent's platform window as the child window's platform window.
2013-08-15 13:33:50 -07:00
Martin Carlberg bb58a206a8 Fixed: Removed all warnings of conflicting return and parameter types caused by the new compiler 2013-08-12 16:46:14 +02:00
Aparajita Fishman 3beb753c63 Fixed: when constraining a window resize, the horizontal margin was fixed (and too large).
Previously a fixed margin of 40px was maintained at the left/right of a window when resizing it, which was excessive.

Now the minimum size allowed during a resize is the same as the minimum margin allowed when moving a window, which is determined based on the type of window.
2013-08-09 09:16:43 -04:00
Aparajita Fishman d751fea510 Fixed: constraining window's to the screen did not respect a window's minSize.
Previously, when the platform window was resized, windows were moved/resized to stay within the virtual screen, but if the window had a minimum size, it was not respected.

This commit ensures that if a window has a minimum size, it will always be respected.
2013-08-09 09:12:07 -04:00
Aparajita Fishman 6bec4064b5 Fixed: window width was not constrained when platform window was resized.
Previously window heights were constrained to the usable screen when the platform window (virtual screen) resized, but widths were not. The code was there to constrain the width, but it wasn't being used.

This commit ensures the width constraining code is executed.
2013-08-09 08:28:36 -04:00
Aparajita Fishman 9fb966d0ca Docs 2013-08-09 08:28:36 -04:00
Aparajita Fishman 2183c6d383 New: added methods to globally turn off window constraining when resizing the platform window.
Previously, whenever the platform window (virtual screen) resized, windows were moved or resized to keep them on screen. This could not be easily overridden by the user.

Two class methods have been added:

CPWindow +setConstrainWindowsToUsableScreen:
CPWindow +constrainWindowsToUsableScreen

If +setConstrainWindowsToUsableScreen:NO is called, then resizing the platform window will not move or resize user windows.
2013-08-09 08:28:36 -04:00
aparajita 6c2062c1f0 Merge pull request #1882 from ahankinson/fix-theme-disabled-controls
Theming fixes for disabled controls in Aristo2
2013-05-21 06:51:21 -07:00
Antoine Mercadal ec3fb2bd33 Merge branch 'WindowSheet' of https://github.com/Dogild/cappuccino into pr-1918 2013-05-07 11:20:49 -07:00
Alexandre Wilhelm e22d6e0217 Removed on pixel at the top of a sheet window 2013-05-06 15:28:49 -07:00
Alexandre Wilhelm 2e93e4abf7 Fixed: Sheet window under the toolbar
Previously when using a sheet window in a fullPlatform window, the sheet window started the animation under (the layout) the toolbar.
Now, the sheet animation starts below the toolbar as in cocoa.
It also fixed that only a CPBordelessWindow/CPTitleWindow/HUD can have a toolbar.
2013-04-29 16:16:29 -07:00
Ilya Kulakov 7ccf7c731c Consistent approach to handle child windows.
When added, level of child window is reset to level of the parent.
A user may change it aftewards to the level that may even break
specified relative position.

E.g. if a child window is added below the parent (Normal)
and its level is set to Floating it will be ordered above.

Whenever you change level of the parent window, levels of the child
windows are reset as well ignoring all your changes.

According to the example, if you set level of the parent to Normal+1,
child window' level will also be set to Normal+1 and its relative
order to the parent (below) will be restored.
2013-04-26 19:46:38 +07:00
Ilya Kulakov 920204fc63 Revert "It's important to order out child windows before parent window relationship is broken."
This reverts commit c6553016d3.
2013-04-26 17:57:00 +07:00
Ilya Kulakov c6553016d3 It's important to order out child windows before parent window relationship is broken. 2013-04-23 01:32:08 +07:00
Andrew Hankinson 8fee6578c2 Fixed: Minor typo in CPWindow comment 2013-03-28 10:36:46 -04:00
Aparajita Fishman 03b663463d Fixed: couldn't set the first responder of a sheet
Previously the sheet was made key at the beginning of the animation. It turns out events would not reliably make it to the sheet during animation. The other problem is that if a text field was the first responder, at the beginning of the animation it is offscreen, which means it refuses first responder and sets the first responder to nil.

Now we no longer try to make the sheet key before the animation ends, avoiding the text field problem.
2013-03-14 00:30:37 -04:00
Aparajita Fishman 7df34cc709 Fixed: windows with sheets were filtering mouse move events.
Previously, if a window had a sheet, a mouse move event was passed to the sheet and then filtered. This disabled resize cursors for the parent window of a sheet.

This commit allows mouse move events to continue to the parent window so that resize cursors will work on the parent window as well.
2013-03-13 15:09:02 -04:00
Aparajita Fishman 3301754af2 Fixed: a sheet's parent window did not become main
Sheets are like child windows, they can never become main. Previously, when an attempt was made to make a sheet the main window, its parent window did not become main as it should have. Thus the title bar would remain dimmed, even though the sheet was the key window.

With this commit, when a sheet is made main, it defers to the parent window.
2013-03-13 15:04:34 -04:00
Aparajita Fishman 25d5441444 Fixed: sheet opening animation was not cleaned up when sheet immediately closed
Previously, if an event occurred during the sheet opening animation that would close the sheet, the animation was not properly cleaned up and the subsequent closing animation would die horribly.

The animation is always cleaned up with this commit.
2013-03-13 14:52:45 -04:00