Enforce minimimum window size when resizing player (#342)
For audio-only .mov files, which are 0x0. Closes #340
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
- Fix installation bugs with .deb file (Linux)
|
- Fix installation bugs with .deb file (Linux)
|
||||||
- Pause audio reliably when closing the window
|
- Pause audio reliably when closing the window
|
||||||
|
- Enforce minimimum window size when resizing player (for audio-only .mov files, which are 0x0)
|
||||||
|
|
||||||
## v0.3.1 - 2016-04-06
|
## v0.3.1 - 2016-04-06
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
WINDOW_ABOUT: 'file://' + path.join(__dirname, 'renderer', 'about.html'),
|
WINDOW_ABOUT: 'file://' + path.join(__dirname, 'renderer', 'about.html'),
|
||||||
|
WINDOW_MAIN: 'file://' + path.join(__dirname, 'renderer', 'main.html'),
|
||||||
WINDOW_WEBTORRENT: 'file://' + path.join(__dirname, 'renderer', 'webtorrent.html'),
|
WINDOW_WEBTORRENT: 'file://' + path.join(__dirname, 'renderer', 'webtorrent.html'),
|
||||||
WINDOW_MAIN: 'file://' + path.join(__dirname, 'renderer', 'main.html')
|
|
||||||
|
WINDOW_MIN_HEIGHT: 38 + (120 * 2), // header height + 2 torrents
|
||||||
|
WINDOW_MIN_WIDTH: 425
|
||||||
}
|
}
|
||||||
|
|
||||||
function isProduction () {
|
function isProduction () {
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ function createMainWindow () {
|
|||||||
backgroundColor: '#1E1E1E',
|
backgroundColor: '#1E1E1E',
|
||||||
darkTheme: true, // Forces dark theme (GTK+3)
|
darkTheme: true, // Forces dark theme (GTK+3)
|
||||||
icon: config.APP_ICON + '.png',
|
icon: config.APP_ICON + '.png',
|
||||||
minWidth: 425,
|
minWidth: config.WINDOW_MIN_WIDTH,
|
||||||
minHeight: 38 + (120 * 2), // header height + 2 torrents
|
minHeight: config.WINDOW_MIN_HEIGHT,
|
||||||
show: false, // Hide window until DOM finishes loading
|
show: false, // Hide window until DOM finishes loading
|
||||||
title: config.APP_WINDOW_TITLE,
|
title: config.APP_WINDOW_TITLE,
|
||||||
titleBarStyle: 'hidden-inset', // Hide OS chrome, except traffic light buttons (OS X)
|
titleBarStyle: 'hidden-inset', // Hide OS chrome, except traffic light buttons (OS X)
|
||||||
|
|||||||
@@ -954,8 +954,14 @@ function setDimensions (dimensions) {
|
|||||||
Math.min(screenWidth / dimensions.width, 1),
|
Math.min(screenWidth / dimensions.width, 1),
|
||||||
Math.min(screenHeight / dimensions.height, 1)
|
Math.min(screenHeight / dimensions.height, 1)
|
||||||
)
|
)
|
||||||
var width = Math.floor(dimensions.width * scaleFactor)
|
var width = Math.max(
|
||||||
var height = Math.floor(dimensions.height * scaleFactor)
|
Math.floor(dimensions.width * scaleFactor),
|
||||||
|
config.WINDOW_MIN_WIDTH
|
||||||
|
)
|
||||||
|
var height = Math.max(
|
||||||
|
Math.floor(dimensions.height * scaleFactor),
|
||||||
|
config.WINDOW_MIN_HEIGHT
|
||||||
|
)
|
||||||
|
|
||||||
// Center window on screen
|
// Center window on screen
|
||||||
var x = Math.floor((screenWidth - width) / 2)
|
var x = Math.floor((screenWidth - width) / 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user