mirror of
https://github.com/atom/atom.git
synced 2026-02-07 05:05:02 -05:00
Merge branch 'master' into as-ns-startup-snapshot
This commit is contained in:
@@ -694,8 +694,14 @@ class AtomEnvironment extends Model
|
||||
@deserialize(state) if state?
|
||||
@deserializeTimings.atom = Date.now() - startTime
|
||||
|
||||
if process.platform is 'darwin' and @config.get('core.useCustomTitleBar')
|
||||
if process.platform is 'darwin' and @config.get('core.titleBar') is 'custom'
|
||||
@workspace.addHeaderPanel({item: new TitleBar({@workspace, @themes, @applicationDelegate})})
|
||||
@document.body.classList.add('custom-title-bar')
|
||||
if process.platform is 'darwin' and @config.get('core.titleBar') is 'custom-inset'
|
||||
@workspace.addHeaderPanel({item: new TitleBar({@workspace, @themes, @applicationDelegate})})
|
||||
@document.body.classList.add('custom-inset-title-bar')
|
||||
if process.platform is 'darwin' and @config.get('core.titleBar') is 'hidden'
|
||||
@document.body.classList.add('hidden-title-bar')
|
||||
|
||||
@document.body.appendChild(@views.getView(@workspace))
|
||||
@backgroundStylesheet?.remove()
|
||||
|
||||
@@ -498,10 +498,11 @@ if (['win32', 'linux'].includes(process.platform)) {
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
configSchema.core.properties.useCustomTitleBar = {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Use custom, theme-aware title bar.<br>Note: This currently does not include a proxy icon.<br>This setting will require a relaunch of Atom to take effect.'
|
||||
configSchema.core.properties.titleBar = {
|
||||
type: 'string',
|
||||
default: 'native',
|
||||
enum: ['native', 'custom', 'custom-inset', 'hidden'],
|
||||
description: 'Experimental: A `custom` title bar adapts to theme colors. Choosing `custom-inset` adds a bit more padding. The title bar can also be completely `hidden`.<br>Note: Switching to a custom or hidden title bar will compromise some functionality.<br>This setting will require a relaunch of Atom to take effect.'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,13 @@ class AtomApplication
|
||||
initialize: (options) ->
|
||||
global.atomApplication = this
|
||||
|
||||
@config.onDidChange 'core.useCustomTitleBar', @promptForRestart.bind(this)
|
||||
# DEPRECATED: This can be removed at some point (added in 1.13)
|
||||
# It converts `useCustomTitleBar: true` to `titleBar: "custom"`
|
||||
if process.platform is 'darwin' and @config.get('core.useCustomTitleBar')
|
||||
@config.unset('core.useCustomTitleBar')
|
||||
@config.set('core.titleBar', 'custom')
|
||||
|
||||
@config.onDidChange 'core.titleBar', @promptForRestart.bind(this)
|
||||
|
||||
@autoUpdateManager = new AutoUpdateManager(
|
||||
@version, options.test or options.benchmark or options.benchmarkTest, @resourcePath, @config
|
||||
|
||||
@@ -43,9 +43,15 @@ class AtomWindow
|
||||
if process.platform is 'linux'
|
||||
options.icon = @constructor.iconPath
|
||||
|
||||
if @shouldHideTitleBar()
|
||||
if @shouldAddCustomTitleBar()
|
||||
options.titleBarStyle = 'hidden'
|
||||
|
||||
if @shouldAddCustomInsetTitleBar()
|
||||
options.titleBarStyle = 'hidden-inset'
|
||||
|
||||
if @shouldHideTitleBar()
|
||||
options.frame = false
|
||||
|
||||
@browserWindow = new BrowserWindow(options)
|
||||
@handleEvents()
|
||||
|
||||
@@ -226,10 +232,20 @@ 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'
|
||||
|
||||
shouldAddCustomInsetTitleBar: ->
|
||||
not @isSpec and
|
||||
process.platform is 'darwin' and
|
||||
@atomApplication.config.get('core.titleBar') is 'custom-inset'
|
||||
|
||||
shouldHideTitleBar: ->
|
||||
not @isSpec and
|
||||
process.platform is 'darwin' and
|
||||
@atomApplication.config.get('core.useCustomTitleBar')
|
||||
@atomApplication.config.get('core.titleBar') is 'hidden'
|
||||
|
||||
close: -> @browserWindow.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user