app/@overflow/commons/ui/component/window/window-controls.component.ts

35 lines
601 B
TypeScript
Raw Normal View History

2018-08-14 12:26:23 +00:00
import { Component, OnInit } from '@angular/core';
import { ipcRenderer, remote } from 'electron';
@Component({
2018-08-15 14:54:10 +00:00
selector: 'app-window-controls',
2018-08-14 12:26:23 +00:00
templateUrl: './window-controls.component.html',
})
export class WindowControlsComponent implements OnInit {
2018-09-06 02:17:32 +00:00
windowState: string;
2018-08-14 12:26:23 +00:00
constructor(
) { }
ngOnInit() {
}
2018-09-06 02:17:32 +00:00
onMinimize(event) {
2018-08-14 12:26:23 +00:00
remote.getCurrentWindow().minimize();
}
2018-09-06 02:17:32 +00:00
onRestore(event) {
2018-08-14 12:26:23 +00:00
remote.getCurrentWindow().unmaximize();
}
2018-09-06 02:17:32 +00:00
onMaximize(event) {
2018-08-14 12:26:23 +00:00
remote.getCurrentWindow().maximize();
}
2018-09-06 02:17:32 +00:00
onClose(event) {
2018-08-14 12:26:23 +00:00
remote.getCurrentWindow().close();
}
}