How to use the @nodegui/nodegui.AspectRatioMode.KeepAspectRatio 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
QApplication
} from '@nodegui/nodegui';
import { NgWindow } from '../../../../projects/angular-nodegui/src/lib/components/window';
import * as os from 'os';

@Component({
  // tslint:disable-next-line: component-selector
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class AppComponent implements OnInit {
  @ViewChild('window', { static: true }) window: ElementRef;

  public aspectRatioMode: AspectRatioMode = AspectRatioMode.KeepAspectRatio;
  public date: Date = new Date();

  constructor() {}

  /**
   * Init component and configure window widget
   */
  ngOnInit() {
    const win = this.window.nativeElement.parent;

    win.hide();
    win.resize(300, 340);

    win.setWindowFlag(WindowType.FramelessWindowHint, true);
    win.setWindowFlag(WindowType.Widget, true);
github irustm / angular-nodegui / src / app / app.component.ts View on Github external
import { NgWindow } from '../../projects/angular-nodegui/src/lib/components/window';

const windowHeight = 480;
const windowWeight = 620;

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class AppComponent implements OnInit {
  @ViewChild('window', { static: true }) window: ElementRef;

  public name = 'irustm';
  public aspectRatioMode = AspectRatioMode.KeepAspectRatio;

  constructor(private router: Router) {}

  /**
   * Init component and configure window widget
   */
  ngOnInit(): void {
    const win = this.window.nativeElement.parent;

    win.resize(windowHeight, windowWeight);
    win.setMinimumSize(windowHeight, windowWeight);
  }

  /**
   * Change router
   */
github nodegui / react-nodegui / examples / weather-app-widget / src / components / WeatherIcon.tsx View on Github external
export const WeatherIcon = React.memo(props => {
  const iconId = props.icon || "na";
  const imageUrl = `${path.resolve(assetUrl, `${iconId}.png`)}`;
  return (
    <img src="{imageUrl}">
  );
});