mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 21:28:40 -09:00
Cleanup getWindowHeaderConfig (#1378)
This commit is contained in:
parent
fc685c7d02
commit
95e98006c0
1 changed files with 11 additions and 9 deletions
|
|
@ -102,19 +102,21 @@ export default class Header extends Component {
|
||||||
|
|
||||||
getWindowHeaderConfig() {
|
getWindowHeaderConfig() {
|
||||||
const {showHamburgerMenu, showWindowControls} = this.props;
|
const {showHamburgerMenu, showWindowControls} = this.props;
|
||||||
const ret = {
|
|
||||||
|
const defaults = {
|
||||||
hambMenu: process.platform === 'win32', // show by default on windows
|
hambMenu: process.platform === 'win32', // show by default on windows
|
||||||
winCtrls: !this.props.isMac // show by default on windows and linux
|
winCtrls: !this.props.isMac // show by default on windows and linux
|
||||||
};
|
};
|
||||||
if (!this.props.isMac) { // allow the user to override the defaults if not on macOS
|
|
||||||
if (showHamburgerMenu !== '') {
|
// don't allow the user to change defaults on MacOS
|
||||||
ret.hambMenu = showHamburgerMenu;
|
if (this.props.isMac) {
|
||||||
}
|
return defaults;
|
||||||
if (showWindowControls !== '') {
|
|
||||||
ret.winCtrls = showWindowControls;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
|
return {
|
||||||
|
hambMenu: showHamburgerMenu === '' ? defaults.hambMenu : showHamburgerMenu,
|
||||||
|
winCtrls: showWindowControls === '' ? defaults.winCtrls : showWindowControls
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template(css) {
|
template(css) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue