July 2017
Intermediate to advanced
300 pages
5h 43m
English
Until now, our title bar was not really useful. Thanks to the Photon framework, we can already use it as a handle to drag and drop the window across the viewport, yet we are missing windowing actions such as close, maximize, and restore window.
Let's implement them:
./app/js/Components/Header.jsx
import { remote } from "electron"; const win = remote.getCurrentWindow(); export default class
Header extends React.Component { //.... onRestore = () => { win.restore(); } onMaximize = () => { win.maximize(); } onClose = () => { win.close();
} //... }
Read now
Unlock full access