mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Only store backgroundColor and gutterBackgroundColor on presenter
This commit is contained in:
@@ -23,8 +23,6 @@ TextEditorComponent = React.createClass
|
||||
|
||||
visible: false
|
||||
autoHeight: false
|
||||
backgroundColor: null
|
||||
gutterBackgroundColor: null
|
||||
pendingScrollTop: null
|
||||
pendingScrollLeft: null
|
||||
selectOnMouseMove: false
|
||||
@@ -98,7 +96,7 @@ TextEditorComponent = React.createClass
|
||||
|
||||
LinesComponent {
|
||||
ref: 'lines', @presenter, editor, hostElement, @useHardwareAcceleration, useShadowDOM,
|
||||
mouseWheelScreenRow, visible, @backgroundColor
|
||||
mouseWheelScreenRow, visible
|
||||
}
|
||||
|
||||
ScrollbarComponent
|
||||
@@ -773,16 +771,11 @@ TextEditorComponent = React.createClass
|
||||
{hostElement} = @props
|
||||
{backgroundColor} = getComputedStyle(hostElement)
|
||||
|
||||
if backgroundColor isnt @backgroundColor
|
||||
@backgroundColor = backgroundColor
|
||||
@presenter.setBackgroundColor(backgroundColor)
|
||||
@presenter.setBackgroundColor(backgroundColor)
|
||||
|
||||
if @refs.gutter?
|
||||
gutterBackgroundColor = getComputedStyle(@refs.gutter.getDOMNode()).backgroundColor
|
||||
if gutterBackgroundColor isnt @gutterBackgroundColor
|
||||
@gutterBackgroundColor = gutterBackgroundColor
|
||||
@presenter.setGutterBackgroundColor(gutterBackgroundColor)
|
||||
@requestUpdate() unless suppressUpdate
|
||||
@presenter.setGutterBackgroundColor(gutterBackgroundColor)
|
||||
|
||||
measureLineHeightAndDefaultCharWidth: ->
|
||||
if @isVisible()
|
||||
|
||||
@@ -389,13 +389,17 @@ class TextEditorPresenter
|
||||
|
||||
getClientWidth: -> @clientWidth
|
||||
|
||||
setBackgroundColor: (@backgroundColor) ->
|
||||
@updateContentState()
|
||||
setBackgroundColor: (backgroundColor) ->
|
||||
if backgroundColor isnt @backgroundColor
|
||||
@backgroundColor = backgroundColor
|
||||
@updateContentState()
|
||||
|
||||
getBackgroundColor: -> @backgroundColor
|
||||
|
||||
setGutterBackgroundColor: (@gutterBackgroundColor) ->
|
||||
@updateGutterState()
|
||||
setGutterBackgroundColor: (gutterBackgroundColor) ->
|
||||
if gutterBackgroundColor isnt @gutterBackgroundColor
|
||||
@gutterBackgroundColor = gutterBackgroundColor
|
||||
@updateGutterState()
|
||||
|
||||
getGutterBackgroundColor: -> @gutterBackgroundColor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user