mirror of
https://github.com/atom/atom.git
synced 2026-02-11 23:25:03 -05:00
Add custom-inset title-bar
This commit is contained in:
@@ -698,6 +698,9 @@ class AtomEnvironment extends Model
|
||||
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')
|
||||
|
||||
|
||||
@@ -360,8 +360,8 @@ if (process.platform === 'darwin') {
|
||||
configSchema.core.properties.titleBar = {
|
||||
type: 'string',
|
||||
default: 'native',
|
||||
enum: ['native', 'custom', 'hidden'],
|
||||
description: 'Use a custom, theme-aware title bar or hide the title bar altogether.<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.'
|
||||
enum: ['native', 'custom', 'custom-inset', 'hidden'],
|
||||
description: '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.'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,12 @@ class AtomWindow
|
||||
if @shouldAddCustomTitleBar()
|
||||
options.titleBarStyle = 'hidden'
|
||||
|
||||
if @shouldHideTitleBar()
|
||||
if @shouldAddCustomInsetTitleBar()
|
||||
options.titleBarStyle = 'hidden-inset'
|
||||
|
||||
if @shouldHideTitleBar()
|
||||
options.frame = false
|
||||
|
||||
@browserWindow = new BrowserWindow options
|
||||
@atomApplication.addWindow(this)
|
||||
|
||||
@@ -234,6 +237,11 @@ class AtomWindow
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user