<commit_before>import MainThreadReceiver from "./mainThreadReceiver";
import menubar from "menubar";
import IconResolver from "./IconResolver";
import { MainMenu } from "./mainMenu";

export class Initializer {
  constructor({
    mainWindow,
    isDevMode,
    indexPath,
    iconPath,
    big,
    app,
    openDevTools
  }) {
    this.mainWindow = mainWindow;
    this.isDevMode = isDevMode || false;
    this.receiver = new MainThreadReceiver();
    this.hasBeenSetup = false;
    this.indexPath = indexPath;
    this.iconPath = iconPath;
    this.big = big || false;
    this.app = app;
    this.openDevTools = openDevTools || false;
  }
  initialize() {
    this.hideMainWindow();
    const mb = this.initMenubar();
    this.setupSignaling();
    this.setupMainMenu(mb);
  }
  hideMainWindow() {
    if (this.mainWindow) {
      this.mainWindow.hide();
    }
  }
  setupSignaling() {
    this.receiver.setup();
  }
  setupMainMenu(mb) {
    const mm = new MainMenu(this.app, mb.tray);
    mm.initialize();
  }
  getWindowDimensions() {
    if (this.big) {
      return { width: 1024, height: 768 };
    }
    return { width: 280, height: 180 };
  }

  initMenubar() {
    const iconPath = new IconResolver(
      process.platform,
      this.iconPath
    ).resolve();
    const dimensions = this.getWindowDimensions();
    const alwaysOnTop = false;
    const mb = menubar({
      dir: __dirname,
      icon: iconPath,
      preloadWindow: true,
      width: dimensions.width,
      height: dimensions.height,
      index: this.indexPath,
      alwaysOnTop
    });
    mb.on("ready", () => {
      console.log("app is ready");
    });
    mb.on("after-show", () => {
      if (this.hasBeenSetup) return;

      if (this.openDevTools) {
        mb.window.webContents.openDevTools("detach");
      }
      this.hasBeenSetup = true;
    });
    return mb;<commit_msg>Improve window styles<commit_after>import MainThreadReceiver from "./mainThreadReceiver";
import menubar from "menubar";
import IconResolver from "./IconResolver";
import { MainMenu } from "./mainMenu";

export class Initializer {
  constructor({
    mainWindow,
    isDevMode,
    indexPath,
    iconPath,
    big,
    app,
    openDevTools
  }) {
    this.mainWindow = mainWindow;
    this.isDevMode = isDevMode || false;
    this.receiver = new MainThreadReceiver();
    this.hasBeenSetup = false;
    this.indexPath = indexPath;
    this.iconPath = iconPath;
    this.big = big || false;
    this.app = app;
    this.openDevTools = openDevTools || false;
  }
  initialize() {
    this.hideMainWindow();
    const mb = this.initMenubar();
    this.setupSignaling();
    this.setupMainMenu(mb);
  }
  hideMainWindow() {
    if (this.mainWindow) {
      this.mainWindow.hide();
    }
  }
  setupSignaling() {
    this.receiver.setup();
  }
  setupMainMenu(mb) {
    const mm = new MainMenu(this.app, mb.tray);
    mm.initialize();
  }
  getWindowDimensions() {
    if (this.big) {
      return { width: 1024, height: 768 };
    }
    return { width: 280, height: 180 };
  }

  initMenubar() {
    const iconPath = new IconResolver(
      process.platform,
      this.iconPath
    ).resolve();
    const dimensions = this.getWindowDimensions();
    const alwaysOnTop = false;
    const mb = menubar({
      dir: __dirname,
      icon: iconPath,
      preloadWindow: true,
      width: dimensions.width,
      height: dimensions.height,
      index: this.indexPath,
      alwaysOnTop,
      resizable: false,
      movable: false,
      skipTaskbar: true,
      frame: false,
      autoHideMenuBar: true
    });
    mb.on("ready", () => {
      console.log("app is ready");
    });
    mb.on("after-show", () => {
      if (this.hasBeenSetup) return;

      if (this.openDevTools) {
        mb.window.webContents.openDevTools("detach");
      }
      this.hasBeenSetup = true;
    });
    return mb;
{'fraction_non_alphanumeric': 0.1297828335056877, 'fraction_numerical': 0.00672182006204757, 'mean_word_length': 2.5923862581244195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7213547', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1231, 'n_words': 265}