Commit Graph
143 Commits
Author SHA1 Message Date
daboe01 915047b996 fixed: scrollview white border view in HUD 2026-03-07 11:22:41 +01:00
daboe01 125673880c fixed: cornerview in HUD 2026-03-06 19:45:55 +01:00
daboe01 3c1c01fd9f Merge remote-tracking branch 'upstream/main' into Aristo3 2026-01-02 21:53:59 +01:00
daboe01 0ef1239283 fixed: CPScrollView did not send some notifications 2025-09-03 15:21:44 +03:00
daboe01 b608709014 resolved: missed conflict 2022-03-23 17:52:36 +01:00
daboe01 0450136af3 Merge branch 'pl_2719' into Aristo3 2022-03-23 06:59:28 +01:00
daboe01 effb274410 Merge branch 'pl_2932' into Aristo3 2022-03-23 06:56:39 +01:00
Martin CarlbergandGitHub 68a113e7ee Fixed: New Cocoa api that replace old deprecated for calculating content and frame size of scroll view (#3023)
Old deprecated api did not work as it was accessing ivars _horizontalScroller and _verticalScroller from class method.
New Cocoa api is added as described in Apple Developer Documentation.

Also added type CPScrollerStyle
2022-03-21 15:25:09 +01:00
Didier KorthoudtandGitHub 5110c5706f Fixed: Compilation warnings (#2950) 2020-11-06 07:25:21 +01:00
Didier Korthoudt 500237b2c8 Update CPScrollView.j
- new theme parameters
- Aristo3 CSS theme ready
2020-08-29 22:03:48 +02:00
Martin CarlbergandGitHub 7dc77ed609 Fixed: Make sure we handle undefined when testing for nil values (#2862) 2020-01-31 13:43:58 +01:00
Didier KorthoudtandGitHub eca41e7474 Merge branch 'master' into CPScrollView-scrollerStyle-fix 2018-08-23 11:08:51 +02:00
Didier KorthoudtandMartin Carlberg 73f02cc1bf NEW: Add first responder management based on content view to CPScrollView (#2757) 2018-08-21 09:14:21 +02:00
cacaodevandMartin Carlberg fd3acc456d FIXED: Before this commit, CPScrollerView was not correctly differentiating the scroller-width attribute (#2740)
between the vertical scroller and the horizontal scroller.
The scroller width was picked from a common CPScroller instance cached in CPScroller.
The bug was not visible because the method -_adjustScrollerSize was correcting the size repeatidly in the layout pass.
This was causing unnecessary calls to setFrame: in a performance sensitive method (triggered by scroll events).
The ScrollView is now picking the right width from the theme and a setFrame: call is skipped.

Tests: Manual/CPScrollView2/

TODO : The _adjustScrollerSize method should be enabled with a flag only when a width change is explicitely requested.
2018-08-20 10:36:59 +02:00
Didier Korthoudt 9107322d28 setGlobalScrollerStyle-fixes 2018-06-16 17:51:52 +02:00
Didier Korthoudt f5ca6c39f6 Revert "Revert "Revert "CPScrollView-scrollerStyle-fix"""
This reverts commit 653fdb999e.
2018-06-02 22:08:59 +02:00
Didier Korthoudt 653fdb999e Revert "Revert "CPScrollView-scrollerStyle-fix""
This reverts commit f25d76d0d6.
2018-05-29 12:19:03 +02:00
Didier Korthoudt f25d76d0d6 Revert "CPScrollView-scrollerStyle-fix"
This reverts commit 31fe918b3d.
2018-05-29 12:16:36 +02:00
Didier Korthoudt 31fe918b3d CPScrollView-scrollerStyle-fix 2018-05-23 23:58:48 +02:00
daniel 29f66bdfed Formatting: add missing semi-colon to CPScrollView.j 2018-04-04 14:41:53 -07:00
Antoine Mercadal 547764e3c1 FIXED: Always call [super awakeFromCib] in CPView subclasses 2015-08-14 01:43:55 -07:00
Alexandre Wilhelm a439688b3c Doc: move private variables to the top of files to not show them in the documentation 2015-05-15 09:55:17 -07:00
Alexandre Wilhelm 51bdfa44b1 New: added the protocol CPScrollViewDelegate 2015-03-12 14:39:42 -07:00
Alexandre Wilhelm 81b538556d Fixed: removed unused var in CPScrollView.j 2015-03-04 13:01:32 -08:00
Alexandre Wilhelm b36cc8f1e9 Fixed: Memory leak in CPTableView, CPScrollView
Prevously, when removing a CPTableView or a CPScrollView, the CPNotificationCenter kept a reference of these observers in the notification center.

Now, the CPNotificationCenter does only have a observer when necessary.
2014-11-25 17:33:17 -08:00
Alexander Ljungberg 07c0de71ec New: support line-by-line scrolling with old scroll wheel devices in Firefox.
Without this change, using a traditional scroll wheel mouse with discrete steps would result in very slow scrolling in Firefox.

With this fix we handle these events like in Cocoa: as "[im]preciseScrollingDeltas", which `CPScrollView` in turn knows to apply the configurable line scroll amount for. For backwards compatibility, [event deltaX] and [event deltaY] are premultiplied with a suitable constant, while [event scrollingDeltaX] and [event scrollingDeltaY] show the true values needed.

Browsers other than Firefox seem to always send pixel scrolling information even for old style scrolling devices, at least on the Mac, so are not affected by this change.

Fixes #2013.
2014-07-23 15:04:07 +01:00
daboe01 0f2ec90064 documentVisibleRect support 2014-06-14 08:14:38 +02:00
Aparajita Fishman d8281a6e22 Fixed: simplified the overlay scroller test, documented the technique.
Previously the inner element's offsetWidth was tested before and after setting the overflow to scroll. This is unnecessary, we can just set the overflow to scroll and test the outer element's clientWidth vs. offsetWidth. By definition, clientWidth does not include scrollbars, whereas offsetWidth does. So if they are equal then overlay scrollers must be in use.

Note that FireFox (as of version 22) does not support overlay scrollers, so even if the system does, Cappuccino will not on FireFox unless the programmer forces overlay scrollers.
2013-07-27 09:27:58 -04:00
Aparajita Fishman bdd29936d7 Fixed: test for fixed scrollbars was broken by a previous commit. 2013-07-26 23:38:20 -04:00
Aparajita Fishman 639670e47d Formatting 2013-07-23 10:15:49 -04:00
Aparajita Fishman afd5925499 Fixed: _CG and _CP macros were confusing and could degrade performance
Previously, Cappuccino was using preprocessor macros internally for the CGPoint/Size/Rect/Inset/Affine functions, as well as for CPRange. These macros had the same name as the corresponding function, but began with _. The functions were actually defined using the macros.

The motivation behind using macros was to increase performance by reducing function calls. However, there were a number of problems with this approach:

- There was an artificial dichotomy between _CG macros and the corresponding CG functions. We never completely replaced CG function calls with _CG macros. In fact, they were often mixed up in the same file. There was an extra burden on the programmer to remember to use the macro instead of the function.
- If a method call was passed as an argument to a macro, performance could actually be significantly *worse* than a function call. For example, _CGGetRectMakeCopy([view frame]) would expand to `{ origin:{ x:[view frame].origin.x, y:[view frame].origin.y }, size:{ width:[view frame].size.width, height:[view frame].size.height } }`. So instead of a single objj_msgSend and a single simple function call, we ended up with 4 objj_msgSend calls, which are way more expensive than simple function calls.
- Because of this expansion problem, to use macros efficiently required us to remember to use variables for all macro parameters. This didn't happen, and shouldn't have to happen.
- Finally, with modern Javascript engines, function call overhead is so small that it really isn't worth using the macros.

This commit eliminates the _CGGeometry, CGAffineTransformation and CPRange macros and replaces them with function calls.

BREAKING CHANGE:
The macros are no longer available. They could only be used with compiled code, but if there is any user code that used them, they will have to be replaced with the corresponding functions.
2013-03-13 12:22:10 -04:00
Alexander Ljungberg 5b05dc92a1 More dictionary literals. 2013-02-25 18:27:44 +00:00
Aparajita Fishman 7c831fa19d capp_lint flags deprecated CPPoint/Rect/Size types/functions
- Changed to corresponding CG types/functions in all files
- Fixed some demo app bugs
2013-01-19 16:51:56 +07:00
Alexandre Wilhelm e840e4a547 Fixed bug about the width of legacy scrollView 2013-01-16 14:12:07 -08:00
Alexander Ljungberg 2b1b1ea33b Fixed: CPScrollView setGlobalScrollerStyle: return value. 2012-12-12 17:45:59 +00:00
Ilya Kulakov ee1c5478b1 Fix frame of CPScrollView is calculated incorrectly. 2012-09-03 03:41:14 +07:00
Aparajita Fishman cae5486ec6 Added missing class checks in +initialize, regularized checking code 2012-06-28 12:05:18 -07:00
Aparajita Fishman 36bfc7c675 Fixed decode methods to return the correct defaults, removed unnecessary containsValueForKey and || with defaults 2012-04-24 10:15:19 +02:00
Aparajita Fishman bd691d5307 Hopefully finally fixed the problem with CPScrollView/CPScroller initialization. Fixes #1485. 2012-04-23 01:12:24 +02:00
Aparajita Fishman 9830b2b115 Subviews may not be accessed during initWithCoder. Fixes #1485. 2012-04-22 23:13:58 +02:00
Alexander Ljungberg f2571e6536 Don't draw a table corner view if there is no vertical scrollbar.
This could either be due to autohiding or they usage of overlay scrollbars. Not showing it matches Cocoa and makes sense because it takes up space for no reason without the scrollbar.
2012-03-18 17:56:20 +00:00
Alexander Ljungberg bec8a4b1c6 Fixed: scroll views with a bezel border had two strange dots in the upper corners instead of a Lion-like bezel. 2012-03-18 16:56:04 +00:00
Alexander Ljungberg 028fb03ef1 Slightly optimise scroll view border drawing code. 2012-03-18 16:41:39 +00:00
Alexander Ljungberg 65aa08a9d9 Format code. 2012-03-18 16:38:51 +00:00
Jacek Galowicz 3b5aa1a2ab CPScrollView: Documented delegate methods 2012-03-01 18:44:51 +01:00
Alexander Ljungberg eacee00fc8 Merge branch 'master' of github.com:cappuccino/cappuccino 2012-02-08 15:58:00 +00:00
Alexander Ljungberg fe70a5541e Fixes #1450: a scroll view with non hiding legacy scrollbars would crash if the document view had a size of 0 pixels in either dimension. 2012-02-08 15:52:59 +00:00
Randall Luecke dd7d36da43 call layoutSubviews when the tableview lays out its subviews. 2012-02-02 19:34:11 -05:00
Aparajita Fishman 1c2a304ee5 Assignment of function is a statement and should be semicolon terminated. Some miscellaneous linting as well. 2012-01-05 17:51:37 -10:00
Alexander Ljungberg 63c500c444 Fixed: overlay scroll knobs never quite reached the edge.
The calculation of the number of pixels outside of the clip view assumed fixed, space consuming scrollbars even when overlay scrollbars were used, leading CPScrollView to always think a few more pixels could be revealed.
2011-10-27 15:57:29 +01:00