Coder Social home page Coder Social logo

zhs2010 / custom-electron-titlebar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alextorresdev/custom-electron-titlebar

0.0 0.0 0.0 1.47 MB

Custom electon title bar inpire on VS Code title bar

Home Page: https://alextorressk.github.io/custom-electron-titlebar/

License: MIT License

JavaScript 2.82% TypeScript 92.78% HTML 0.87% SCSS 3.53%

custom-electron-titlebar's Introduction

Custom Electron Titlebar

This project is a typescript library for electron that allows you to configure a fully customizable title bar.

LICENSE NPM Version install size

Screenshot 1

Screenshot 2

Screenshot 3

๐Ÿ“ฆ Installing

You can install this package with npm.

npm install custom-electron-titlebar

๐Ÿ› ๏ธ Usage

The implementation is done as follows:

In the main application file (main.js or .ts)

import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/main";

// setup the titlebar main process
setupTitlebar();

function createWindow() {
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    titleBarStyle: 'hidden',
    //frame: false, // needed if process.versions.electron < 14
    webPreferences: {
      sandbox: false,
      preload: path.join(__dirname, 'preload.js')
    }
  });
  
  ...

  // attach fullscreen(f11 and not 'maximized') && focus listeners
  attachTitlebarToWindow(mainWindow);
}

In the preload file (preload.js or .ts)

import { Titlebar } from "custom-electron-titlebar";

window.addEventListener('DOMContentLoaded', () => {
  // Title bar implemenation
  new Titlebar();
});

To see the options you can include in the Title Bar constructor, such as color of elements, icons, menu position, and much more, and the methods you can use, go to the wiki

๐Ÿ’ฐ Support

If you want to support my development, you can do so by donating through Buy me a coffee or Patreon

โœ… License

This project is under the MIT license.

custom-electron-titlebar's People

Contributors

alextorresdev avatar araxeus avatar wagslane avatar 4gray avatar nicolasnewman avatar madff386 avatar mairwunnx avatar anandsiddharth avatar robgonnella avatar yafp avatar max-programming avatar ericblade avatar jeongtae avatar jsayol avatar reptarsrage avatar kiyozz avatar lehoczky avatar bosznorbi avatar tomotoes avatar mithom avatar revelmind avatar dependabot[bot] avatar minhloi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.