mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Implement menu bar toggling
This commit is contained in:
parent
ee7d4003de
commit
7bcf92e55a
@ -503,7 +503,11 @@ class Atom extends Model
|
|||||||
@packages.activate()
|
@packages.activate()
|
||||||
@keymaps.loadUserKeymap()
|
@keymaps.loadUserKeymap()
|
||||||
@requireUserInitScript() unless safeMode
|
@requireUserInitScript() unless safeMode
|
||||||
|
|
||||||
@menu.update()
|
@menu.update()
|
||||||
|
@subscribe @config.onDidChange 'core.autoHideMenuBar', ({newValue}) =>
|
||||||
|
@setAutoHideMenuBar(newValue)
|
||||||
|
@setAutoHideMenuBar(true) if @config.get('core.autoHideMenuBar')
|
||||||
|
|
||||||
maximize = dimensions?.maximized and process.platform isnt 'darwin'
|
maximize = dimensions?.maximized and process.platform isnt 'darwin'
|
||||||
@displayWindow({maximize})
|
@displayWindow({maximize})
|
||||||
@ -723,3 +727,6 @@ class Atom extends Model
|
|||||||
|
|
||||||
setBodyPlatformClass: ->
|
setBodyPlatformClass: ->
|
||||||
document.body.classList.add("platform-#{process.platform}")
|
document.body.classList.add("platform-#{process.platform}")
|
||||||
|
|
||||||
|
setAutoHideMenuBar: (autoHide) ->
|
||||||
|
ipc.send('call-window-method', 'setAutoHideMenuBar', autoHide)
|
||||||
|
@ -60,6 +60,8 @@ class WindowEventHandler
|
|||||||
atom.reload()
|
atom.reload()
|
||||||
|
|
||||||
@subscribeToCommand $(window), 'window:toggle-dev-tools', -> atom.toggleDevTools()
|
@subscribeToCommand $(window), 'window:toggle-dev-tools', -> atom.toggleDevTools()
|
||||||
|
@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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user