Rename ThemeManager methods for clarity/consistency

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2015-01-08 17:51:09 -08:00
committed by Max Brunsfeld
parent d999b4eca0
commit 30513cfde0
6 changed files with 43 additions and 30 deletions

View File

@@ -721,7 +721,7 @@ class Atom extends Model
@themes.load()
watchThemes: ->
@themes.onDidReloadAll =>
@themes.onDidChangeActiveThemes =>
# Only reload stylesheets from non-theme packages
for pack in @packages.getActivePackages() when pack.getType() isnt 'theme'
pack.reloadStylesheets?()

View File

@@ -185,7 +185,7 @@ TextEditorComponent = React.createClass
@subscribe stylesElement.onDidUpdateStyleElement @onStylesheetsChanged
@subscribe stylesElement.onDidRemoveStyleElement @onStylesheetsChanged
unless atom.themes.isInitialLoadComplete()
@subscribe atom.themes.onDidReloadAll @onAllThemesLoaded
@subscribe atom.themes.onDidChangeActiveThemes @onAllThemesLoaded
@subscribe scrollbarStyle.changes, @refreshScrollbars
@domPollingIntervalId = setInterval(@pollDOM, @domPollingInterval)

View File

@@ -61,8 +61,12 @@ class ThemeManager
# updating the list of active themes have completed.
#
# * `callback` {Function}
onDidChangeActiveThemes: (callback) ->
@emitter.on 'did-change-active-themes', callback
onDidReloadAll: (callback) ->
@emitter.on 'did-reload-all', callback
Grim.deprecate("Use `::onDidChangeActiveThemes` instead.")
@onDidChangeActiveThemes(callback)
# Deprecated: Invoke `callback` when a stylesheet has been added to the dom.
#
@@ -132,9 +136,13 @@ class ThemeManager
###
# Public: Get an array of all the loaded theme names.
getLoadedNames: ->
getLoadedThemeNames: ->
theme.name for theme in @getLoadedThemes()
getLoadedNames: ->
Grim.deprecate("Use `::getLoadedThemeNames` instead.")
@getLoadedThemeNames()
# Public: Get an array of all the loaded themes.
getLoadedThemes: ->
pack for pack in @packageManager.getLoadedPackages() when pack.isTheme()
@@ -144,9 +152,13 @@ class ThemeManager
###
# Public: Get an array of all the active theme names.
getActiveNames: ->
getActiveThemeNames: ->
theme.name for theme in @getActiveThemes()
getActiveNames: ->
Grim.deprecate("Use `::getActiveThemeNames` instead.")
@getActiveThemeNames()
# Public: Get an array of all the active themes.
getActiveThemes: ->
pack for pack in @packageManager.getActivePackages() when pack.isTheme()
@@ -323,7 +335,7 @@ class ThemeManager
@reloadBaseStylesheets()
@initialLoadComplete = true
@emit 'reloaded'
@emitter.emit 'did-reload-all'
@emitter.emit 'did-change-active-themes'
deferred.resolve()
deferred.promise