UNPKG

project-nexus

Version:

A hub for all your programming projects

35 lines (26 loc) 798 B
win = nw.Window.get() class @GtkHeaderBar extends React.Component constructor: -> @state = maximized: no render: -> E ".titlebar", E TitleButton, key: "close" action: -> window.close() icon: "close" @props.children ? E ".title", document.title E TitleButton, if @state.maximized key: "maximization" action: -> win.restore() icon: "restore" else key: "maximization" action: -> win.maximize() icon: "fullscreen" componentDidMount: -> win.on "maximize", @onmaximize = => @setState maximized: yes win.on "unmaximize", @onunmaximize = => @setState maximized: no componentWillUnmount: -> win.removeListener "maximize", @onmaximize win.removeListener "unmaximize", @onunmaximize