mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -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() {
|
||||
const {showHamburgerMenu, showWindowControls} = this.props;
|
||||
const ret = {
|
||||
|
||||
const defaults = {
|
||||
hambMenu: process.platform === 'win32', // show by default on windows
|
||||
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 !== '') {
|
||||
ret.hambMenu = showHamburgerMenu;
|
||||
}
|
||||
if (showWindowControls !== '') {
|
||||
ret.winCtrls = showWindowControls;
|
||||
}
|
||||
|
||||
// don't allow the user to change defaults on MacOS
|
||||
if (this.props.isMac) {
|
||||
return defaults;
|
||||
}
|
||||
return ret;
|
||||
|
||||
return {
|
||||
hambMenu: showHamburgerMenu === '' ? defaults.hambMenu : showHamburgerMenu,
|
||||
winCtrls: showWindowControls === '' ? defaults.winCtrls : showWindowControls
|
||||
};
|
||||
}
|
||||
|
||||
template(css) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue