Skip to content

Commit

Permalink
re #75 #73 MacOs Mojave fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilian committed Jan 4, 2019
1 parent a22646e commit 2f0f58c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
1 change: 1 addition & 0 deletions app/assets/style/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ body[data-platform=darwin] {
}

#root > div {
height:100%;
transition:0.4s ease filter;
}

Expand Down
2 changes: 1 addition & 1 deletion app/containers/FromScratch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default class FromScratch extends React.Component {
const style = {
fontSize: `${this.state.fontSize}rem`,
...(this.state.lightTheme ?
{ filter: 'invert(100%) hue-rotate(20deg) brightness(1.1) grayscale(50%)' }
{ filter: 'invert(100%) hue-rotate(20deg) brightness(1.1) contrast(1.4) grayscale(20%)' }
:
{}
)
Expand Down
24 changes: 16 additions & 8 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ const { app, BrowserWindow, ipcMain: ipc, Menu: menu, globalShortcut: gsc, shell
const isDev = process.env.NODE_ENV === 'development';
let mainWindow = null;

const isSecondInstance = app.makeSingleInstance(() => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});
const gotTheLock = app.requestSingleInstanceLock();

if (isSecondInstance) {
if (!gotTheLock) {
app.quit();
} else {
app.on('second-instance', () => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
})

if (isDev) {
require('electron-debug')(); // eslint-disable-line global-require
}
Expand Down Expand Up @@ -108,6 +110,8 @@ Optional arguments:
global.handleContent.write(arg);
});

const currentLightTheme = nodeStorage.getItem('lightTheme') || false;

const windowSettings = {
show: false,
title: app.getName(),
Expand All @@ -120,15 +124,18 @@ Optional arguments:
titleBarStyle: 'hidden',
autoHideMenuBar: true,
transparent: true,
resizable: true,
webPreferences: {
blinkFeatures: 'OverlayScrollbars',
nodeIntegration: true
},
};

if (process.platform === 'darwin') {
ipc.on('setVibrancy', (event, lightTheme) => {
mainWindow.setVibrancy(lightTheme ? 'medium-light' : 'ultra-dark');
});
windowSettings.backgroundColor = currentLightTheme ? '#00ffffff' : '#00002b36';
} else {
windowSettings.backgroundColor = '#002b36';
}
Expand All @@ -137,6 +144,7 @@ Optional arguments:
mainWindow.loadURL(`file://${__dirname}/app.html`);

mainWindow.on('ready-to-show', () => {
mainWindow.setVibrancy(currentLightTheme ? 'medium-light' :'ultra-dark');
mainWindow.show();
// Restore maximised state if it is set. not possible via options so we do it here
if (windowState.isMaximized) {
Expand Down
2 changes: 1 addition & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FromScratch",
"version": "1.4.2",
"version": "1.4.3",
"description": "simple autosaving scratchpad",
"main": "./main.prod.js",
"repository": {
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fromscratch",
"productName": "FromScratch",
"version": "1.4.2",
"version": "1.4.3",
"description": "simple autosaving scratchpad",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
Expand Down Expand Up @@ -114,10 +114,10 @@
"cross-spawn": "^6.0.5",
"css-loader": "^0.28.11",
"detect-port": "^1.2.3",
"electron": "^2.0.8",
"electron-builder": "20.14.7",
"electron": "^4.0.0",
"electron-builder": "^20.38.4",
"electron-devtools-installer": "^2.2.4",
"electron-rebuild": "^1.7.3",
"electron-rebuild": "^1.8.2",
"eslint": "^5.0.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-prettier": "^2.9.0",
Expand All @@ -128,7 +128,7 @@
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.8.2",
"express": "^4.16.3",
"express": "^4.16.4",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fbjs-scripts": "^0.8.3",
"file-loader": "^1.1.11",
Expand All @@ -137,22 +137,22 @@
"node-sass": "^4.9.0",
"npm-logical-tree": "^1.2.1",
"prettier": "^1.12.1",
"rimraf": "^2.6.2",
"rimraf": "^2.6.3",
"sass-loader": "^7.0.1",
"style-loader": "^0.21.0",
"stylefmt": "^6.0.0",
"stylefmt": "^6.0.3",
"stylelint": "^9.2.1",
"stylelint-config-standard": "^18.2.0",
"uglifyjs-webpack-plugin": "^1.2.6",
"url-loader": "^1.0.1",
"webpack": "^4.12.1",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.1.2"
},
"dependencies": {
"compare-versions": "^3.1.0",
"compare-versions": "^3.4.0",
"devtron": "^1.4.0",
"electron-debug": "^2.0.0",
"minimist": "^1.2.0",
Expand Down

0 comments on commit 2f0f58c

Please sign in to comment.