Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Hiding close button on non-macOS systems
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Jan 6, 2019
1 parent 52f404e commit 4710b0e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/renderer/components/main/titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import * as React from 'react';
import {ipcRenderer as ipc} from 'electron';
import * as is from 'electron-is';

/* HELPERS */

Expand All @@ -12,11 +13,13 @@ const windowClose = () => ipc.send ( 'window-close' );

const Titlebar = ({ title, titles, onChange }) => (
<div id="titlebar">
<div id="titlebar-close" onClick={windowClose}>
<svg x="0px" y="0px" viewBox="0 0 6.4 6.4">
<polygon fill="#4d0000" points="6.4,0.8 5.6,0 3.2,2.4 0.8,0 0,0.8 2.4,3.2 0,5.6 0.8,6.4 3.2,4 5.6,6.4 6.4,5.6 4,3.2"></polygon>
</svg>
</div>
{!is.macOS () ? null : (
<div id="titlebar-close" onClick={windowClose}>
<svg x="0px" y="0px" viewBox="0 0 6.4 6.4">
<polygon fill="#4d0000" points="6.4,0.8 5.6,0 3.2,2.4 0.8,0 0,0.8 2.4,3.2 0,5.6 0.8,6.4 3.2,4 5.6,6.4 6.4,5.6 4,3.2"></polygon>
</svg>
</div>
)}
<div id="titlebar-title">
<span>{title}</span>
<select id="titlebar-select" value={title} onChange={onChange}>
Expand Down

0 comments on commit 4710b0e

Please sign in to comment.