[MM-38649] Put top bar in a BrowserView (#1758)
* [MM-38649] Tab bar as BrowserView POC * Fixes for Mac * Linux fixes * Lint fix * Make view full height * Fix for macOS getting stuck when dragging * Lint fix
This commit is contained in:
@@ -17,7 +17,6 @@ import {DEFAULT_WINDOW_HEIGHT, DEFAULT_WINDOW_WIDTH, MINIMUM_WINDOW_HEIGHT, MINI
|
||||
|
||||
import * as Validator from '../Validator';
|
||||
import ContextMenu from '../contextMenu';
|
||||
import {getLocalPreload, getLocalURLString} from '../utils';
|
||||
|
||||
function saveWindowState(file: string, window: BrowserWindow) {
|
||||
const windowState: SavedWindowState = {
|
||||
@@ -39,7 +38,6 @@ function isFramelessWindow() {
|
||||
|
||||
function createMainWindow(config: CombinedConfig, options: {linuxAppIcon: string}) {
|
||||
// Create the browser window.
|
||||
const preload = getLocalPreload('mainWindow.js');
|
||||
const boundsInfoPath = path.join(app.getPath('userData'), 'bounds-info.json');
|
||||
let savedWindowState;
|
||||
try {
|
||||
@@ -55,8 +53,6 @@ function createMainWindow(config: CombinedConfig, options: {linuxAppIcon: string
|
||||
|
||||
const {maximized: windowIsMaximized} = savedWindowState;
|
||||
|
||||
const spellcheck = (typeof config.useSpellChecker === 'undefined' ? true : config.useSpellChecker);
|
||||
|
||||
const windowOptions: BrowserWindowConstructorOptions = Object.assign({}, savedWindowState, {
|
||||
title: app.name,
|
||||
fullscreenable: true,
|
||||
@@ -74,8 +70,6 @@ function createMainWindow(config: CombinedConfig, options: {linuxAppIcon: string
|
||||
nodeIntegration: process.env.NODE_ENV === 'test',
|
||||
contextIsolation: process.env.NODE_ENV !== 'test',
|
||||
disableBlinkFeatures: 'Auxclick',
|
||||
preload,
|
||||
spellcheck,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -92,24 +86,13 @@ function createMainWindow(config: CombinedConfig, options: {linuxAppIcon: string
|
||||
log.error('Tried to register second handler, skipping');
|
||||
}
|
||||
|
||||
const localURL = getLocalURLString('index.html');
|
||||
mainWindow.loadURL(localURL).catch(
|
||||
(reason) => {
|
||||
log.error(`Main window failed to load: ${reason}`);
|
||||
});
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.webContents.zoomLevel = 0;
|
||||
|
||||
mainWindow.once('show', () => {
|
||||
mainWindow.show();
|
||||
if (windowIsMaximized) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
});
|
||||
|
||||
mainWindow.once('show', () => {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
mainWindow.once('restore', () => {
|
||||
mainWindow.restore();
|
||||
});
|
||||
|
Reference in New Issue
Block a user