Commit Graph

27 Commits

Author SHA1 Message Date
Nathan Sobo
8e834794a9 Remove scroll listener on destroy so we don’t call undefined onScroll
/cc @izuzak because no PR, @as-cii because this fixes an unexpected
issue with your change.
2015-10-07 16:52:37 -05:00
Antonio Scandurra
1df9162389 Clear references to scrollbar components 2015-10-07 19:02:45 +02:00
Jess Lin
79b460a0ca [Gutter] Add ::getDomNode method to all 'components' 2015-04-22 07:28:59 -07:00
Antonio Scandurra
0dca5a5fcd Encapsulate state update inside TextEditorPresenter#getState 2015-02-28 09:25:53 +01:00
Nathan Sobo
dc752eda20 Update scrollHeight/Width before scrollTop/Left in dummy scrollbars
This avoids jerky scroll behavior when auto-scrolling at the margins.
2015-02-19 17:15:03 -07:00
Nathan Sobo
77a4482263 Fix assignment of oldState values in ScrollbarComponent
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-19 17:14:55 -07:00
Nathan Sobo
da6bd3664d Use plain JS object for ScrollbarComponent instead of React 2015-02-19 17:14:54 -07:00
Nathan Sobo
d9e100cdf8 Perform ScrollbarComponent DOM updates manually 2015-02-19 17:14:54 -07:00
Nathan Sobo
c06e100fae Make LinesComponent a normal object instead of a React component
Also, remove ability to disable hardware acceleration since there’s
no longer a need for it and it complicated this conversion.
2015-02-19 17:14:53 -07:00
Nathan Sobo
bbc1a264b5 Make each section of presenter state self-contained
This means we have some duplicated values in different parts of the
tree, but it’s cleaner in the view since each component only consumes
a single object. Seems like the presenter should convey the correct
data to the correct locations and minimize the logic in the view. A
few duplicated integers is a reasonable trade-off.
2015-02-03 15:05:31 -07:00
Nathan Sobo
efdba9fc24 Use presenter state for scrollbars and scrollbar corner 2015-02-03 15:05:31 -07:00
Nathan Sobo
100af7d27d Fix corner cases related to lifecycle state of EditorComponent on events
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:28 -07:00
Nathan Sobo
b86f6870c5 Use native event handlers instead of React
React event handlers don’t work because of the shadow DOM
2014-11-04 16:37:22 -07:00
Nathan Sobo
bac99222f3 Force scrollbars to be GPU layers when acceleration is enabled
Fixes #3559

For some reason, Chromium 37 is not compositing scrollbars correctly on
secondary monitors in OS X. They’re invisible when the lines layer
extends beneath the scrollbars unless we apply this style.
2014-09-19 15:10:04 -06:00
Nathan Sobo
a71a524ec7 Rework DOM measurement to try to prevent measurement errors
* Simplify scrollbar refresh and measurement by using imperative DOM
  manipulation instead of React to hide/show scrollbars.
* Rename `::performInitialMeasurement` to `::becameVisible`
* Break `::checkForVisibilityChange` out of `::pollDOM` and use it in
  to check for the element becoming visible in `componentWillUpdate`.
* Don't rely on stored visibility state anywhere. Always check again.
  This could potentially be cached for an update cycle but being wrong
  about this is disastrous so I'm being conservative.
2014-08-21 17:50:46 -06:00
Ben Ogle
2a9c78ef92 Move horiz scrollbar into the scrollView
Also remove all the gutter width calculation. It was flawed anyway,
2014-07-23 16:20:48 -07:00
Ben Ogle
d3a6e79428 The horizontal scrollbar takes gutter width into account 2014-07-22 18:26:58 -07:00
Nathan Sobo
e754689014 Add displayName to ScrollbarComponent and ScrollbarCornerComponent 2014-05-22 16:01:48 -06:00
Nathan Sobo
65b1e13b83 Use Atom-specific fork of React allowing selection restoration opt out
This fork of React allows data-react-skip-selection-restoration to be
defined on input elements, skipping costly selection restoration that
occurs when the input element is focused during reconciliation.
2014-05-20 23:05:13 -06:00
Nathan Sobo
bdd605e85b Explicitly assign dummy scrollbars to the correct width/height
Previously, dummy scrollbars were always 15px wide/tall. This caused
them to obscure the ability to click for the entire 15px region, even if
the actual scrollbar was styled to be much thinner. Now we explicitly
measure the size of scrollbars on mount and when the stylesheets change
and set the height/width explicitly.
2014-05-09 11:33:04 -06:00
Nathan Sobo
e1b4b921ba Hide scrollbar when not scrollable in a given direction 2014-05-09 11:33:04 -06:00
Nathan Sobo
dbd271f70a Don't obscure last character of long lines with vertical scrollbar
This entailed quite a few changes to dial in scrollbars. The scrollbars
are now adjusted in size to account for the width of the opposite
scrollbar. If the width or height are not explicitly constrained and we
are scrollable in the opposite direction that is constrained, we account
for the width of the opposite scrollbar in assigning a natural height
or width based on the content.
2014-05-09 11:33:04 -06:00
Nathan Sobo
e6df30e94c Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we
can't actually scroll in that direction, causing the white square where
neither scrollbar overlaps to appear at the lower right corner.
2014-05-09 11:33:03 -06:00
Nathan Sobo
64a487eebb Implement shouldComponentUpdate for ScrollbarComponent
It checks that the incoming scrollTop/Left and scrollHeight/Width differ
from their current values. The scrollTop/Left value are updated in
the component properties to always reflect the state of the DOM when
scrolling or when assigning a new value.
2014-04-22 17:09:43 -06:00
Nathan Sobo
aee552476a Call onScroll with the current scrollTop/Left in ScrollbarComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo
355abef2cf Manage update of scrollbar scroll positions in ScrollbarComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo
cec62c56a6 Extract a ScrollbarComponent 2014-04-22 17:09:41 -06:00