Apply window background color after resizing window

This commit is contained in:
Max Brunsfeld
2016-01-27 13:00:18 -08:00
parent 32f5149196
commit 28e535ee15
2 changed files with 9 additions and 26 deletions

View File

@@ -524,6 +524,7 @@ class AtomEnvironment extends Model
displayWindow: ->
@restoreWindowDimensions().then (dimensions) =>
steps = [
@restoreWindowBackground(),
@show(),
@focus()
]
@@ -603,6 +604,13 @@ class AtomEnvironment extends Model
dimensions = @getWindowDimensions()
@state.windowDimensions = dimensions if @isValidDimensions(dimensions)
restoreWindowBackground: ->
if backgroundColor = window.localStorage.getItem('atom:window-background-color')
@backgroundStylesheet = document.createElement('style')
@backgroundStylesheet.type = 'text/css'
@backgroundStylesheet.innerText = 'html, body { background: ' + backgroundColor + ' !important; }'
document.head.appendChild(@backgroundStylesheet)
storeWindowBackground: ->
return if @inSpecMode()
@@ -627,6 +635,7 @@ class AtomEnvironment extends Model
@packages.loadPackages()
@loadStateSync()
@document.body.appendChild(@views.getView(@workspace))
@backgroundStylesheet?.remove()
@watchProjectPath()