cleanup(atom): Get rid of core.autoHideMenuBar option—we'll never show a menu bar on windows

This commit is contained in:
Ben Gotow 2015-09-11 14:55:59 -07:00
parent ece7f2e649
commit 08db0d61a9
5 changed files with 1 additions and 23 deletions

View file

@ -641,6 +641,7 @@ class Atom extends Model
@requireUserInitScript() unless safeMode @requireUserInitScript() unless safeMode
@menu.update() @menu.update()
@commands.add 'atom-workspace', @commands.add 'atom-workspace',
'atom-workspace:add-account': => 'atom-workspace:add-account': =>
@newWindow @newWindow
@ -687,9 +688,6 @@ class Atom extends Model
@setWindowDimensions({width, height}) if width and height @setWindowDimensions({width, height}) if width and height
@menu.update() @menu.update()
@subscribe @config.onDidChange 'core.autoHideMenuBar', ({newValue}) =>
@setAutoHideMenuBar(newValue)
@setAutoHideMenuBar(true) if @config.get('core.autoHideMenuBar')
ipc.sendChannel('window-command', 'window:loaded') ipc.sendChannel('window-command', 'window:loaded')
@ -903,10 +901,6 @@ class Atom extends Model
updateAvailable: (details) -> updateAvailable: (details) ->
@emitter.emit 'update-available', details @emitter.emit 'update-available', details
setAutoHideMenuBar: (autoHide) ->
ipc.send('call-window-method', 'setAutoHideMenuBar', autoHide)
ipc.send('call-window-method', 'setMenuBarVisibility', !autoHide)
# Lets multiple components register beforeUnload callbacks. # Lets multiple components register beforeUnload callbacks.
# The callbacks are expected to return either true or false. # The callbacks are expected to return either true or false.
# #

View file

@ -24,7 +24,6 @@ class AtomWindow
toolbar, toolbar,
resizable, resizable,
pathToOpen, pathToOpen,
hideMenuBar,
@isSpec, @isSpec,
@devMode, @devMode,
@safeMode, @safeMode,
@ -57,7 +56,6 @@ class AtomWindow
height: height height: height
resizable: resizable ? true resizable: resizable ? true
icon: @constructor.iconPath icon: @constructor.iconPath
'auto-hide-menu-bar': hideMenuBar
'web-preferences': 'web-preferences':
'direct-write': true 'direct-write': true
'subpixel-font-scaling': true 'subpixel-font-scaling': true

View file

@ -266,7 +266,6 @@ class WindowManager
devMode: @devMode devMode: @devMode
safeMode: @safeMode safeMode: @safeMode
windowType: 'popout' windowType: 'popout'
hideMenuBar: true
resourcePath: @resourcePath resourcePath: @resourcePath
bootstrapScript: require.resolve("../window-secondary-bootstrap") bootstrapScript: require.resolve("../window-secondary-bootstrap")

View file

@ -1,6 +1,3 @@
path = require 'path'
fs = require 'fs-plus'
# This is loaded by atom.coffee. See https://atom.io/docs/api/latest/Config for # This is loaded by atom.coffee. See https://atom.io/docs/api/latest/Config for
# more information about config schemas. # more information about config schemas.
module.exports = module.exports =
@ -56,9 +53,3 @@ module.exports =
type: 'string' type: 'string'
default: 'reply-all' default: 'reply-all'
enum: ['reply', 'reply-all'] enum: ['reply', 'reply-all']
if process.platform in ['win32', 'linux']
module.exports.core.properties.autoHideMenuBar =
type: 'boolean'
default: false
description: 'Automatically hide the menu bar and toggle it by pressing Alt. This is only supported on Windows & Linux.'

View file

@ -82,10 +82,6 @@ class WindowEventHandler
ReactRemote = require './react-remote/react-remote-parent' ReactRemote = require './react-remote/react-remote-parent'
ReactRemote.toggleContainerVisible() ReactRemote.toggleContainerVisible()
if process.platform in ['win32', 'linux']
@subscribeToCommand $(window), 'window:toggle-menu-bar', ->
atom.config.set('core.autoHideMenuBar', !atom.config.get('core.autoHideMenuBar'))
@subscribeToCommand $(document), 'core:focus-next', @focusNext @subscribeToCommand $(document), 'core:focus-next', @focusNext
@subscribeToCommand $(document), 'core:focus-previous', @focusPrevious @subscribeToCommand $(document), 'core:focus-previous', @focusPrevious