From cdf477682a3923d770596442549d229d413ef5a2 Mon Sep 17 00:00:00 2001 From: haraldox Date: Tue, 20 Feb 2018 12:17:14 +0100 Subject: [WIP] incorporate electron-react-titlebar --- src/components/layout/AppLayout.js | 123 ++++++++++++++++++++----------------- src/lib/Menu.js | 6 +- src/styles/layout.scss | 10 ++- 3 files changed, 79 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 20dc2f764..4f047368a 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -2,9 +2,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; +import { TitleBar } from 'electron-react-titlebar'; import InfoBar from '../ui/InfoBar'; import globalMessages from '../../i18n/globalMessages'; +import Menu from '../../lib/Menu'; function createMarkup(HTMLString) { return { __html: HTMLString }; @@ -87,64 +89,69 @@ export default class AppLayout extends Component { return (
- {sidebar} -
- {news.length > 0 && news.map(item => ( - removeNewsItem({ newsId: item.id })} - > - - - ))} - {!isOnline && ( - - - {intl.formatMessage(globalMessages.notConnectedToTheInternet)} - - )} - {!areRequiredRequestsSuccessful && showRequiredRequestsError && ( - - - {intl.formatMessage(messages.requiredRequestsFailed)} - - )} - {showServicesUpdatedInfoBar && ( - - - {intl.formatMessage(messages.servicesUpdated)} - - )} - {appUpdateIsDownloaded && ( - - - {intl.formatMessage(messages.updateAvailable)} - {intl.formatMessage(messages.changelog)} - - - )} - {services} + + + +
+ {sidebar} +
+ {news.length > 0 && news.map(item => ( + removeNewsItem({ newsId: item.id })} + > + + + ))} + {!isOnline && ( + + + {intl.formatMessage(globalMessages.notConnectedToTheInternet)} + + )} + {!areRequiredRequestsSuccessful && showRequiredRequestsError && ( + + + {intl.formatMessage(messages.requiredRequestsFailed)} + + )} + {showServicesUpdatedInfoBar && ( + + + {intl.formatMessage(messages.servicesUpdated)} + + )} + {appUpdateIsDownloaded && ( + + + {intl.formatMessage(messages.updateAvailable)} + {intl.formatMessage(messages.changelog)} + + + )} + {services} +
{children} diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 703060dc1..0818c94fb 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -124,8 +124,12 @@ export default class FranzMenu { autorun(this._build.bind(this)); } + get template() { + return toJS(this.tpl); + } + _build() { - const tpl = toJS(this.tpl); + const tpl = this.template; tpl[1].submenu.push({ role: 'toggledevtools', diff --git a/src/styles/layout.scss b/src/styles/layout.scss index afdd7dec7..964a9fcea 100644 --- a/src/styles/layout.scss +++ b/src/styles/layout.scss @@ -6,7 +6,11 @@ html { .app { display: flex; - flex-direction: row; + flex-direction: column; + + .app__content { + display: flex; + } .app__service { display: flex; @@ -15,6 +19,10 @@ html { } } +.electron-app-title-bar { + z-index: 99999999; +} + .window-draggable { position: absolute; width: 100%; -- cgit v1.2.3-70-g09d2 From fc76e14df444d1dcb1b3e254125a6f1f3261e192 Mon Sep 17 00:00:00 2001 From: haraldox Date: Tue, 20 Feb 2018 13:23:10 +0100 Subject: choose platform with environment variable `FRANZ_PLATFORM` --- .vscode/launch.json | 3 ++- package.json | 2 +- src/index.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/.vscode/launch.json b/.vscode/launch.json index a8300f84f..9bd373a4d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,8 @@ "program": "${workspaceFolder}/build/index.js", "protocol": "inspector", "env": { - "NODE_ENV": "development" + "NODE_ENV": "development", + "FRANZ_PLATFORM": "win32" } }, { diff --git a/package.json b/package.json index 78f7a3291..60e45f7f6 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "electron ./build", "start:local": "cross-env LOCAL_API=1 yarn start", "start:live": "cross-env LIVE_API=1 yarn start", - "dev": "cross-env NODE_ENV=development gulp dev", + "dev": "cross-env NODE_ENV=development FRANZ_PLATFORM=win32 gulp dev", "lint": "eslint src", "sign": "gulp sign", "prebuild": "gulp build", diff --git a/src/index.html b/src/index.html index 9e5acd705..bb10d2eaf 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@
DEV MODE