mirror of
https://github.com/atom/atom.git
synced 2026-02-13 08:04:56 -05:00
Add a theme-added event to the theme manager
This commit is contained in:
@@ -23,6 +23,9 @@ class ThemeManager
|
||||
getAvailableNames: ->
|
||||
path.basename(themePath).split('.')[0] for themePath in @getAvailablePaths()
|
||||
|
||||
getThemes: ->
|
||||
_.clone(@loadedThemes)
|
||||
|
||||
unload: ->
|
||||
removeStylesheet(@userStylesheetPath) if @userStylesheetPath?
|
||||
theme.deactivate() while theme = @loadedThemes.pop()
|
||||
@@ -38,7 +41,9 @@ class ThemeManager
|
||||
|
||||
loadTheme: (name) ->
|
||||
try
|
||||
theme = new Theme(name)
|
||||
@loadedThemes.push(new Theme(name))
|
||||
@trigger('theme-loaded', theme)
|
||||
catch error
|
||||
console.warn("Failed to load theme #{name}", error.stack ? error)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user