Merge pull request #33 from feross/fullscreen-fixes

Fullscreen fixes
This commit is contained in:
Nate Goldman
2016-03-05 18:37:19 -08:00
2 changed files with 17 additions and 15 deletions

View File

@@ -45,7 +45,7 @@ function addTorrentFromPaste () {
function setBounds (bounds) {
debug('setBounds %o', bounds)
if (windows.main) {
if (windows.main && !windows.main.isFullScreen()) {
windows.main.setBounds(bounds, true)
}
}

View File

@@ -8,7 +8,23 @@ var Header = require('./header')
var Player = require('./player')
var TorrentList = require('./torrent-list')
var isOSX = process.platform === 'darwin'
function App (state, dispatch) {
return hx`
<div class='app'>
${getHeader()}
<div class='content'>${getView()}</div>
</div>
`
function getHeader () {
// Hide the header on Windows/Linux when in the player
if (isOSX || state.url !== '/player') {
return Header(state, dispatch)
}
}
function getView () {
if (state.url === '/') {
return TorrentList(state, dispatch)
@@ -16,18 +32,4 @@ function App (state, dispatch) {
return Player(state, dispatch)
}
}
// Show the header only when we're outside of fullscreen
// Also don't show it in the video player except in OSX
var isOSX = process.platform === 'darwin'
var isVideo = state.url === '/player'
var isFullScreen = state.isFullScreen
var header = !isFullScreen && (!isVideo || isOSX) ? Header(state, dispatch) : null
return hx`
<div class="app">
${header}
<div class="content">${getView()}</div>
</div>
`
}