How to use the @nodegui/nodegui.WidgetAttribute.WA_TranslucentBackground function in @nodegui/nodegui

To help you get started, weโ€™ve selected a few @nodegui/nodegui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github irustm / angular-nodegui / projects / weather-demo / src / app / app.component.ts View on Github external
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();
  }
github nodegui / react-nodegui / examples / weather-app-widget / src / index.tsx View on Github external
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();
};