mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Move global editor stylesheet updating into the ThemeManager
This commit is contained in:
@@ -373,24 +373,13 @@ class WorkspaceView extends View
|
||||
@model.destroy()
|
||||
|
||||
setEditorFontSize: (fontSize) =>
|
||||
@setEditorStyle('font-size', fontSize + 'px')
|
||||
atom.themes.updateGlobalEditorStyle('font-size', fontSize + 'px')
|
||||
|
||||
setEditorFontFamily: (fontFamily) =>
|
||||
@setEditorStyle('font-family', fontFamily)
|
||||
atom.themes.updateGlobalEditorStyle('font-family', fontFamily)
|
||||
|
||||
setEditorLineHeight: (lineHeight) =>
|
||||
@setEditorStyle('line-height', lineHeight)
|
||||
|
||||
setEditorStyle: (property, value) ->
|
||||
unless styleNode = atom.themes.stylesheetElementForId('global-editor-styles')
|
||||
atom.themes.applyStylesheet('global-editor-styles', '.editor {}')
|
||||
styleNode = atom.themes.stylesheetElementForId('global-editor-styles')
|
||||
|
||||
{sheet} = styleNode
|
||||
editorRule = sheet.cssRules[0]
|
||||
editorRule.style[property] = value
|
||||
atom.themes.emit 'stylesheet-updated', sheet
|
||||
atom.themes.emit 'stylesheets-changed'
|
||||
atom.themes.updateGlobalEditorStyle('line-height', lineHeight)
|
||||
|
||||
# Deprecated
|
||||
eachPane: (callback) ->
|
||||
|
||||
Reference in New Issue
Block a user