mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
fullscreen kinda sorta works
This commit is contained in:
@@ -71,7 +71,7 @@ Chrome.bindKey 'end', 'Alt-Shift-.', (env) ->
|
||||
env.editor.navigateFileEnd()
|
||||
|
||||
Chrome.bindKey 'fullscreen', 'Command-Shift-Return', (env) ->
|
||||
Chrome.fullscreen()
|
||||
Chrome.toggleFullscreen()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,11 +43,44 @@ Chrome =
|
||||
title: (text) ->
|
||||
App.window.title = text
|
||||
|
||||
fullscreen: ->
|
||||
OSX.NSMenu.setMenuBarVisible not OSX.NSMenu.menuBarVisible
|
||||
App.mainWindow.orderOut(null)
|
||||
#if mainWindow.screen.isEqual(OSX.NSScreen.screens.objectAtIndex(0)
|
||||
toggleFullscreen: ->
|
||||
if Chrome.fullscreen?
|
||||
Chrome.leaveFullscreen()
|
||||
else
|
||||
Chrome.enterFullscreen()
|
||||
|
||||
leaveFullscreen: ->
|
||||
Chrome.fullscreen = false
|
||||
|
||||
OSX.NSMenu.setMenuBarVisible not OSX.NSMenu.menuBarVisible
|
||||
window = App.window
|
||||
|
||||
enterFullscreen: ->
|
||||
Chrome.fullscreen = true
|
||||
|
||||
OSX.NSMenu.setMenuBarVisible not OSX.NSMenu.menuBarVisible
|
||||
window = App.window
|
||||
|
||||
fullscreenWindow = OSX.NSWindow.alloc.
|
||||
initWithContentRect_styleMask_backing_defer_screen(
|
||||
window.contentRectForFrameRect(window.frame),
|
||||
OSX.NSBorderlessWindowMask,
|
||||
OSX.NSBackingStoreBuffered,
|
||||
true,
|
||||
window.screen)
|
||||
|
||||
contentView = window.contentView
|
||||
window.setContentView OSX.NSView.alloc.init
|
||||
|
||||
fullscreenWindow.setHidesOnDeactivate true
|
||||
fullscreenWindow.setLevel OSX.NSFloatingWindowLevel
|
||||
fullscreenWindow.setContentView contentView
|
||||
fullscreenWindow.setTitle window.title
|
||||
fullscreenWindow.makeFirstResponder null
|
||||
|
||||
fullscreenWindow.makeKeyAndOrderFront null
|
||||
frame = fullscreenWindow.frameRectForContentRect(fullscreenWindow.screen.frame)
|
||||
fullscreenWindow.setFrame_display_animate frame, true, true
|
||||
|
||||
# Handles the file system
|
||||
File =
|
||||
|
||||
Reference in New Issue
Block a user