[MM-22751] Removed Windows 10 style border for non-Windows 10 clients (#1322)
* [MM-22751] Removed Windows 10 style border for non-Windows 10 clients * Lint fix
This commit is contained in:
parent
d49e8dd501
commit
81522a3b2d
|
@ -5,6 +5,7 @@
|
||||||
// This files uses setState().
|
// This files uses setState().
|
||||||
/* eslint-disable react/no-set-state */
|
/* eslint-disable react/no-set-state */
|
||||||
|
|
||||||
|
import os from 'os';
|
||||||
import url from 'url';
|
import url from 'url';
|
||||||
|
|
||||||
import React, {Fragment} from 'react';
|
import React, {Fragment} from 'react';
|
||||||
|
@ -704,7 +705,7 @@ export default class MainPage extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let titleBarButtons;
|
let titleBarButtons;
|
||||||
if (process.platform !== 'darwin') {
|
if (os.platform() === 'win32' && os.release().startsWith('10')) {
|
||||||
titleBarButtons = (
|
titleBarButtons = (
|
||||||
<span className='title-bar-btns'>
|
<span className='title-bar-btns'>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// This file uses setState().
|
// This file uses setState().
|
||||||
/* eslint-disable react/no-set-state */
|
/* eslint-disable react/no-set-state */
|
||||||
|
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {Button, Checkbox, Col, FormGroup, Grid, HelpBlock, Navbar, Radio, Row} from 'react-bootstrap';
|
import {Button, Checkbox, Col, FormGroup, Grid, HelpBlock, Navbar, Radio, Row} from 'react-bootstrap';
|
||||||
|
@ -540,7 +542,7 @@ export default class SettingsPage extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let titleBarButtons;
|
let titleBarButtons;
|
||||||
if (process.platform !== 'darwin') {
|
if (os.platform() === 'win32' && os.release().startsWith('10')) {
|
||||||
titleBarButtons = (
|
titleBarButtons = (
|
||||||
<span className='title-bar-btns'>
|
<span className='title-bar-btns'>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
import {app, BrowserWindow} from 'electron';
|
import {app, BrowserWindow} from 'electron';
|
||||||
|
|
||||||
|
@ -19,6 +20,10 @@ function saveWindowState(file, window) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isFramelessWindow() {
|
||||||
|
return os.platform() === 'darwin' || (os.platform() === 'win32' && os.release().startsWith('10'));
|
||||||
|
}
|
||||||
|
|
||||||
function createMainWindow(config, options) {
|
function createMainWindow(config, options) {
|
||||||
const defaultWindowWidth = 1000;
|
const defaultWindowWidth = 1000;
|
||||||
const defaultWindowHeight = 700;
|
const defaultWindowHeight = 700;
|
||||||
|
@ -51,7 +56,7 @@ function createMainWindow(config, options) {
|
||||||
show: hideOnStartup || false,
|
show: hideOnStartup || false,
|
||||||
minWidth: minimumWindowWidth,
|
minWidth: minimumWindowWidth,
|
||||||
minHeight: minimumWindowHeight,
|
minHeight: minimumWindowHeight,
|
||||||
frame: false,
|
frame: !isFramelessWindow(),
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
titleBarStyle: 'hiddenInset',
|
titleBarStyle: 'hiddenInset',
|
||||||
backgroundColor: '#fff', // prevents blurry text: https://electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
|
backgroundColor: '#fff', // prevents blurry text: https://electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
|
||||||
|
@ -65,6 +70,7 @@ function createMainWindow(config, options) {
|
||||||
|
|
||||||
const mainWindow = new BrowserWindow(windowOptions);
|
const mainWindow = new BrowserWindow(windowOptions);
|
||||||
mainWindow.deeplinkingUrl = options.deeplinkingUrl;
|
mainWindow.deeplinkingUrl = options.deeplinkingUrl;
|
||||||
|
mainWindow.setMenuBarVisibility(false);
|
||||||
|
|
||||||
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
|
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
|
||||||
mainWindow.loadURL(indexURL);
|
mainWindow.loadURL(indexURL);
|
||||||
|
|
Loading…
Reference in a new issue