Retain previous screen sizing on startup #1057
|
@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|||
* Codacy support for Github contributions ([#1059](https://github.com/lbryio/lbry-app/pull/1059))
|
||||
* App category for Linux ([#877](https://github.com/lbryio/lbry-app/pull/877))
|
||||
* Add YouTube Sync reward ([1147](https://github.com/lbryio/lbry-app/pull/1147))
|
||||
* Retain previous screen sizing on startup ([#338](https://github.com/lbryio/lbry-app/issues/338))
|
||||
|
||||
### Changed
|
||||
* Update LBRY Protocol to 0.19.1 (See change log for [0.19.0](https://github.com/lbryio/lbry/releases/tag/v0.19.0) and [0.19.1](https://github.com/lbryio/lbry/releases/tag/v0.19.1))
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
"electron-log": "^2.2.12",
|
||||
"electron-publisher-s3": "^20.2.0",
|
||||
"electron-updater": "^2.21.0",
|
||||
"electron-window-state": "^4.1.1",
|
||||
"find-process": "^1.1.0",
|
||||
"formik": "^0.10.4",
|
||||
"from2": "^2.3.0",
|
||||
|
|
|
@ -1,15 +1,32 @@
|
|||
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
import { app, BrowserWindow, dialog } from 'electron';
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
import { app, BrowserWindow, dialog, screen } from 'electron';
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
import isDev from 'electron-is-dev';
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
import setupBarMenu from './menu/setupBarMenu';
|
||||
import setupContextMenu from './menu/setupContextMenu';
|
||||
|
||||
export default appState => {
|
||||
// Get primary display dimensions from Electron.
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
// Load the previous state with fallback to defaults.
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
const windowState = windowStateKeeper({
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
defaultWidth: width,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
defaultHeight: height,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
});
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
let windowConfiguration = {
|
||||
backgroundColor: '#155B4A',
|
||||
minWidth: 800,
|
||||
minHeight: 600,
|
||||
autoHideMenuBar: true,
|
||||
show: false,
|
||||
// Create the window using the state information.
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
x: windowState.x,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
y: windowState.y,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
// If state is undefined, create window as maximized.
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
width: windowState.width === undefined ? width : windowState.width,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
height: windowState.height === undefined ? height : windowState.height,
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
};
|
||||
|
||||
// Disable renderer process's webSecurity on development to enable CORS.
|
||||
|
@ -28,7 +45,10 @@ export default appState => {
|
|||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
|
||||
let window = new BrowserWindow(windowConfiguration);
|
||||
|
||||
window.maximize();
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
// Let us register listeners on the window, so we can update the state
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
// automatically (the listeners will be removed when the window is closed)
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
// and restore the maximized or full screen state.
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
windowState.manage(window);
|
||||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
||||
|
||||
window.loadURL(rendererURL);
|
||||
|
||||
|
|
|||
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
is there any way that we can have a fully maximized default? is there any way that we can have a fully maximized default?
I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default. I updated this PR so that if the window state is not saved yet (the default situation with new app installs), the display resolution is asked from Electron and that's used as the default.
|
10
yarn.lock
|
@ -3106,6 +3106,14 @@ electron-webpack@^1.13.0:
|
|||
webpack-merge "^4.1.1"
|
||||
yargs "^11.0.0"
|
||||
|
||||
electron-window-state@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/electron-window-state/-/electron-window-state-4.1.1.tgz#6b34fdc31b38514dfec8b7c8f7b5d4addb67632d"
|
||||
dependencies:
|
||||
deep-equal "^1.0.1"
|
||||
jsonfile "^2.2.3"
|
||||
mkdirp "^0.5.1"
|
||||
|
||||
electron@1.7.12:
|
||||
version "1.7.12"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.12.tgz#dcc61a2c1b0c3df25f68b3425379a01abd01190e"
|
||||
|
@ -5640,7 +5648,7 @@ json5@^0.5.0, json5@^0.5.1:
|
|||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
|
||||
|
||||
jsonfile@^2.1.0:
|
||||
jsonfile@^2.1.0, jsonfile@^2.2.3:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
|
||||
optionalDependencies:
|
||||
|
|
is there any way that we can have a fully maximized default?