From 65078fd7d1ec5804e7c44da4a16f9c3986a30bd7 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 23 Oct 2015 18:30:47 -0700 Subject: [PATCH] fix(fullscreen): On Mac OS X, green window control defaults to fullscreen --- src/sheet-toolbar.cjsx | 26 ++++++++++++++++-- .../application-frame/fullscreen@2x.png | Bin 0 -> 2050 bytes static/workspace.less | 14 ++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 static/images/application-frame/fullscreen@2x.png diff --git a/src/sheet-toolbar.cjsx b/src/sheet-toolbar.cjsx index b6f2d972d..e3c48cc2e 100644 --- a/src/sheet-toolbar.cjsx +++ b/src/sheet-toolbar.cjsx @@ -71,13 +71,35 @@ class ToolbarBack extends React.Component class ToolbarWindowControls extends React.Component @displayName: 'ToolbarWindowControls' + constructor: (@props) -> + @state = {alt: false} + + componentDidMount: => + if process.platform is 'darwin' + window.addEventListener('keydown', @_onAlt) + window.addEventListener('keyup', @_onAlt) + + componentWillUnmount: => + if process.platform is 'darwin' + window.removeEventListener('keydown', @_onAlt) + window.removeEventListener('keyup', @_onAlt) + render: => -
+
- +
+ _onAlt: (event) => + @setState(alt: event.altKey) if @state.alt isnt event.altKey + + _onMaximize: (event) => + if process.platform is 'darwin' and not event.altKey + atom.setFullScreen(!atom.isFullScreen()) + else + atom.maximize() + class ToolbarMenuControl extends React.Component @displayName: 'ToolbarMenuControl' render: => diff --git a/static/images/application-frame/fullscreen@2x.png b/static/images/application-frame/fullscreen@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3f1be7fdee915486f8329e41bab1924da7374fd5 GIT binary patch literal 2050 zcmV+d2>thoP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv00000008+zyMF)x010qNS#tmY79{`x79{~mQY7#I00(ACL_t(&-tC!BXk5n~ z$3HXgkF=}R%CQo;HL?zI#U;tbhJvwA5xyAXG&cv4iw`M{ z+fwR~oMK2C1cnq+9!qbI!@J?+!JeQzd*_g3E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CyPoTnd8V gQ{a8aaawZG_iJDj=E_MS?*IS*07*qoM6N<$g6D|8o&W#< literal 0 HcmV?d00001 diff --git a/static/workspace.less b/static/workspace.less index 619a1361e..3bba60e72 100644 --- a/static/workspace.less +++ b/static/workspace.less @@ -108,7 +108,12 @@ atom-workspace { background-image: url("images/application-frame/minimize@1x.png"); } .maximize { - background-image: url("images/application-frame/maximize@1x.png"); + background-image: url("images/application-frame/fullscreen@1x.png"); + } + &.alt-true { + .maximize { + background-image: url("images/application-frame/maximize@1x.png"); + } } } @@ -121,7 +126,12 @@ atom-workspace { background-image: url("images/application-frame/minimize@2x.png"); } .maximize { - background-image: url("images/application-frame/maximize@2x.png"); + background-image: url("images/application-frame/fullscreen@2x.png"); + } + &.alt-true { + .maximize { + background-image: url("images/application-frame/maximize@2x.png"); + } } } }