Skip to content

Commit

Permalink
Add window control min/max classes
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Jun 29, 2023
1 parent c9a9851 commit c50ea44
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/window-controls.js
Expand Up @@ -15,12 +15,18 @@ export class WindowControls {

append(Button('close', () => { win.close() }), this.root)

if (this.layout.minimize)
append(Button('minimize', () => { win.minimize() }), this.root)
if (this.layout.maximize)
if (this.layout.maximize) {
append(Button('maximize', () => { win.maximize() }), this.root)
toggle(win.html, 'window-controls-maximize', true)
}

if (this.layout.minimize) {
append(Button('minimize', () => { win.minimize() }), this.root)
toggle(win.html, 'window-controls-minimize', true)
}

toggle(win.html, `window-controls-${this.layout.placement}`, true)

append(this.root, win.body)
}
}
Expand Down

0 comments on commit c50ea44

Please sign in to comment.