mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Window's title matches TextMate pattern of "#{basename} – #{project.path}"
This commit is contained in:
@@ -47,7 +47,6 @@ class RootView extends View
|
||||
@extensions = {}
|
||||
@project = new Project(pathToOpen)
|
||||
@handleEvents()
|
||||
@setTitle()
|
||||
@loadUserConfiguration()
|
||||
|
||||
if pathToOpen
|
||||
@@ -68,7 +67,7 @@ class RootView extends View
|
||||
@getActiveEditor().focus()
|
||||
false
|
||||
else
|
||||
@setTitle(@project?.getPath())
|
||||
@setTitle(null)
|
||||
focusableChild = this.find("[tabindex=-1]:visible:first")
|
||||
if focusableChild.length
|
||||
focusableChild.focus()
|
||||
@@ -78,7 +77,10 @@ class RootView extends View
|
||||
|
||||
@on 'active-editor-path-change', (e, path) =>
|
||||
@project.setPath(path) unless @project.getRootDirectory()
|
||||
@setTitle(path)
|
||||
if path
|
||||
@setTitle(fs.base(path))
|
||||
else
|
||||
@setTitle("untitled")
|
||||
|
||||
@command 'window:increase-font-size', => @setFontSize(@getFontSize() + 1)
|
||||
@command 'window:decrease-font-size', => @setFontSize(@getFontSize() - 1)
|
||||
@@ -176,10 +178,21 @@ class RootView extends View
|
||||
keymap.bindingsForElement(document.activeElement)
|
||||
|
||||
getTitle: ->
|
||||
@title or 'untitled'
|
||||
@title or "untitled"
|
||||
|
||||
setTitle: (title='untitled') ->
|
||||
@title = document.title = title
|
||||
setTitle: (title) ->
|
||||
projectPath = @project.getPath()
|
||||
if not projectPath
|
||||
@title = "untitled"
|
||||
else if title
|
||||
@title = "#{title} – #{projectPath}"
|
||||
else
|
||||
@title = projectPath
|
||||
|
||||
@updateWindowTitle()
|
||||
|
||||
updateWindowTitle: ->
|
||||
document.title = @title
|
||||
|
||||
setShowInvisibles: (showInvisibles) ->
|
||||
return if @showInvisibles == showInvisibles
|
||||
|
||||
Reference in New Issue
Block a user