Fullscreen support

This commit is contained in:
Jeffrey Morgan 2015-01-13 17:20:27 -05:00
parent 42417c3523
commit b24e5c1d91
6 changed files with 24 additions and 6 deletions

View File

@ -8,16 +8,28 @@ var Header = React.createClass({
handleMinimize: function () { handleMinimize: function () {
remote.getCurrentWindow().minimize(); remote.getCurrentWindow().minimize();
}, },
handleMaximize: function () { handleFullscreen: function () {
remote.getCurrentWindow().setFullScreen(!remote.getCurrentWindow().isFullScreen()); var isFullscreen = remote.getCurrentWindow().isFullScreen();
remote.getCurrentWindow().setFullScreen(!isFullscreen);
this.forceUpdate();
},
handleFullscreenHover: function () {
this.update();
}, },
render: function () { render: function () {
var fullscreenButton;
if (remote.getCurrentWindow().isFullScreen()) {
fullscreenButton = <div className="button button-fullscreenclose" onClick={this.handleFullscreen}></div>;
} else {
fullscreenButton = <div className="button button-fullscreen" onClick={this.handleFullscreen}></div>;
}
return ( return (
<div className="header"> <div className="header">
<div className="buttons"> <div className="buttons">
<div className="button button-close" onClick={this.handleClose}></div> <div className="button button-close" onClick={this.handleClose}></div>
<div className="button button-minimize" onClick={this.handleMinimize}></div> <div className="button button-minimize" onClick={this.handleMinimize}></div>
<div className="button button-maximize" onClick={this.handleMaximize}></div> {fullscreenButton}
</div> </div>
</div> </div>
); );

BIN
app/images/fullscreen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View File

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

View File

@ -23,8 +23,11 @@
.button-close { .button-close {
.at2x('close.png', 10px, 10px); .at2x('close.png', 10px, 10px);
} }
.button-maximize { .button-fullscreen {
.at2x('maximize.png', 10px, 10px); .at2x('fullscreen.png', 10px, 10px);
}
.button-fullscreenclose {
.at2x('fullscreenclose.png', 10px, 10px);
} }
} }
@ -44,7 +47,8 @@
box-shadow: 0px 1px 1px 0px rgba(195,198,201,0.50); box-shadow: 0px 1px 1px 0px rgba(195,198,201,0.50);
} }
&:active { &:hover:active {
cursor: default;
-webkit-filter: brightness(92%); -webkit-filter: brightness(92%);
} }
} }
@ -157,6 +161,7 @@
} }
.logs { .logs {
user-select: text;
overflow: auto; overflow: auto;
font-family: Menlo; font-family: Menlo;
font-size: 12px; font-size: 12px;
@ -174,6 +179,7 @@ html, body {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
user-select: none;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
font-family: 'Helvetica Neue', sans-serif; font-family: 'Helvetica Neue', sans-serif;
} }