[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:
Devin Binnie 2020-06-17 14:54:42 -04:00 committed by GitHub
parent d49e8dd501
commit 81522a3b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View file

@ -5,6 +5,7 @@
// This files uses setState().
/* eslint-disable react/no-set-state */
import os from 'os';
import url from 'url';
import React, {Fragment} from 'react';
@ -704,7 +705,7 @@ export default class MainPage extends React.Component {
}
let titleBarButtons;
if (process.platform !== 'darwin') {
if (os.platform() === 'win32' && os.release().startsWith('10')) {
titleBarButtons = (
<span className='title-bar-btns'>
<div

View file

@ -5,6 +5,8 @@
// This file uses setState().
/* eslint-disable react/no-set-state */
import os from 'os';
import React from 'react';
import PropTypes from 'prop-types';
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;
if (process.platform !== 'darwin') {
if (os.platform() === 'win32' && os.release().startsWith('10')) {
titleBarButtons = (
<span className='title-bar-btns'>
<div

View file

@ -3,6 +3,7 @@
// See LICENSE.txt for license information.
import fs from 'fs';
import path from 'path';
import os from 'os';
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) {
const defaultWindowWidth = 1000;
const defaultWindowHeight = 700;
@ -51,7 +56,7 @@ function createMainWindow(config, options) {
show: hideOnStartup || false,
minWidth: minimumWindowWidth,
minHeight: minimumWindowHeight,
frame: false,
frame: !isFramelessWindow(),
fullscreen: false,
titleBarStyle: 'hiddenInset',
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);
mainWindow.deeplinkingUrl = options.deeplinkingUrl;
mainWindow.setMenuBarVisibility(false);
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
mainWindow.loadURL(indexURL);