Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
const win = this.window.nativeElement.parent;
win.hide();
win.resize(300, 340);
win.setWindowFlag(WindowType.FramelessWindowHint, true);
win.setWindowFlag(WindowType.Widget, true);
const platform: string = os.platform();
if (platform === 'darwin' || platform === 'win32') {
win.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);
}
win.show();
}
const initWindow = (win: QMainWindow) => {
win.hide(); //https://forum.qt.io/topic/60642/framelesswindowhint-fails-at-runtime-on-mainwindow
win.resize(300, 300);
win.setWindowFlag(WindowType.FramelessWindowHint, true);
win.setWindowFlag(WindowType.Widget, true);
if (os.platform() === "darwin") {
win.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);
}
win.show();
};