diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index e1a286179..8348188dc 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -196,7 +196,6 @@ class AtomEnvironment extends Model notificationManager: @notifications, @applicationDelegate, @clipboard, viewRegistry: @views, assert: @assert.bind(this) }) - @titleBar = new TitleBar() if process.platform is 'darwin' @themes.workspace = @workspace @textEditors = new TextEditorRegistry @@ -204,6 +203,9 @@ class AtomEnvironment extends Model @config.load() + # This needs to happen after config.load() + @titleBar = new TitleBar() if process.platform is 'darwin' and @config.get('core.useCustomTitleBar') + @themes.loadBaseStylesheets() @initialStyleElements = @styles.getSnapshot() @themes.initialLoadComplete = true if onlyLoadBaseStyleSheets diff --git a/src/config-schema.coffee b/src/config-schema.coffee index c113f53db..e6bdb03d2 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -266,3 +266,9 @@ if process.platform in ['win32', 'linux'] type: 'boolean' default: false description: 'Automatically hide the menu bar and toggle it by pressing Alt. This is only supported on Windows & Linux.' + +if process.platform is 'darwin' + module.exports.core.properties.useCustomTitleBar = + type: 'boolean' + default: false + description: 'Use custom, theme-aware title-bar.
Note: This currently does not include a file icon or title context menu.
This setting will require a relaunch of Atom to take effect.' diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index ff3a124e2..acc491d7f 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -76,6 +76,8 @@ class AtomApplication @config.setSchema null, {type: 'object', properties: _.clone(require('../config-schema'))} @config.load() + @config.onDidChange 'core.useCustomTitleBar', @promptForRelaunch + @autoUpdateManager = new AutoUpdateManager(@version, options.test, @resourcePath, @config) @applicationMenu = new ApplicationMenu(@version, @autoUpdateManager) @atomProtocolHandler = new AtomProtocolHandler(@resourcePath, @safeMode) @@ -87,6 +89,7 @@ class AtomApplication @setupDockMenu() @storageFolder = new StorageFolder(process.env.ATOM_HOME) + if options.pathsToOpen?.length > 0 or options.urlsToOpen?.length > 0 or options.test @openWithOptions(options) else @@ -706,3 +709,16 @@ class AtomApplication openOptions.defaultPath = path dialog.showOpenDialog(parentWindow, openOptions, callback) + + promptForRelaunch: -> + chosen = dialog.showMessageBox BrowserWindow.getFocusedWindow(), + type: 'warning' + title: 'Relaunch required' + message: "To apply this setting, you'll need to relaunch Atom." + detail: '' + buttons: ['Relaunch Atom', 'Cancel'] + if chosen is 0 + # once we're using electron v.1.2.2 + # app.relaunch() + app.quit() + diff --git a/src/main-process/atom-window.coffee b/src/main-process/atom-window.coffee index 24116f5c9..860211344 100644 --- a/src/main-process/atom-window.coffee +++ b/src/main-process/atom-window.coffee @@ -40,7 +40,7 @@ class AtomWindow if process.platform is 'linux' options.icon = @constructor.iconPath - if process.platform is 'darwin' + if process.platform is 'darwin' and global.atomApplication.config.get('core.useCustomTitleBar') options.titleBarStyle = 'hidden' @browserWindow = new BrowserWindow options diff --git a/static/atom.less b/static/atom.less index 90898ef10..6a8c688e2 100644 --- a/static/atom.less +++ b/static/atom.less @@ -17,11 +17,6 @@ // Core components @import "cursors"; -@import "bootstrap-overrides"; -@import "badges"; -@import "buttons"; -@import "icons"; -@import "links"; @import "panels"; @import "panes"; @import "syntax"; diff --git a/static/workspace-view.less b/static/workspace-view.less index 58be755a4..6d272a018 100644 --- a/static/workspace-view.less +++ b/static/workspace-view.less @@ -1,19 +1,4 @@ @import "ui-variables"; -@import "octicon-mixins"; - -@font-face { .octicon-font(); } - -html { - font-family: @font-family; - font-size: @font-size; -} - -html, -body { - width: 100%; - height: 100%; - overflow: hidden; -} atom-workspace { display: flex;