Add option to hide the title bar

This commit is contained in:
simurai
2016-10-15 19:12:53 +09:00
parent a7f049008a
commit ed2c72a586
5 changed files with 69 additions and 9 deletions

View File

@@ -83,7 +83,7 @@ class AtomApplication
initialize: (options) ->
global.atomApplication = this
@config.onDidChange 'core.useCustomTitleBar', @promptForRestart
@config.onDidChange 'core.titleBar', @promptForRestart
@autoUpdateManager = new AutoUpdateManager(@version, options.test, @resourcePath, @config)
@applicationMenu = new ApplicationMenu(@version, @autoUpdateManager)

View File

@@ -43,6 +43,9 @@ class AtomWindow
if process.platform is 'linux'
options.icon = @constructor.iconPath
if @shouldAddCustomTitleBar()
options.titleBarStyle = 'hidden'
if @shouldHideTitleBar()
options.titleBarStyle = 'hidden-inset'
@@ -227,10 +230,15 @@ class AtomWindow
[width, height] = @browserWindow.getSize()
{x, y, width, height}
shouldAddCustomTitleBar: ->
not @isSpec and
process.platform is 'darwin' and
@atomApplication.config.get('core.titleBar') is 'custom'
shouldHideTitleBar: ->
not @isSpec and
process.platform is 'darwin' and
@atomApplication.config.get('core.useCustomTitleBar')
@atomApplication.config.get('core.titleBar') is 'hidden'
close: -> @browserWindow.close()