@@ -45,7 +45,7 @@ function addTorrentFromPaste () {
|
|||||||
|
|
||||||
function setBounds (bounds) {
|
function setBounds (bounds) {
|
||||||
debug('setBounds %o', bounds)
|
debug('setBounds %o', bounds)
|
||||||
if (windows.main) {
|
if (windows.main && !windows.main.isFullScreen()) {
|
||||||
windows.main.setBounds(bounds, true)
|
windows.main.setBounds(bounds, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,23 @@ var Header = require('./header')
|
|||||||
var Player = require('./player')
|
var Player = require('./player')
|
||||||
var TorrentList = require('./torrent-list')
|
var TorrentList = require('./torrent-list')
|
||||||
|
|
||||||
|
var isOSX = process.platform === 'darwin'
|
||||||
|
|
||||||
function App (state, dispatch) {
|
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 () {
|
function getView () {
|
||||||
if (state.url === '/') {
|
if (state.url === '/') {
|
||||||
return TorrentList(state, dispatch)
|
return TorrentList(state, dispatch)
|
||||||
@@ -16,18 +32,4 @@ function App (state, dispatch) {
|
|||||||
return Player(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>
|
|
||||||
`
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user