1.0.5 • Published 3 years ago

electron-buttons v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Banner

Electron-Buttons GitHub issues GitHub forks GitHub stars GitHub license

Made with ❤️ by JayTheManCHS

Introduction

Electron-Buttons is a lightweight Electron Node Module which allows the creation of custom WindowsTitlebarOverlay Buttons inside of your app.

Quickstart

  1. Install electron-buttons
$ npm install electron-buttons@latest
  1. Require electron-buttons in the Main process
// main.js
const { app, BrowserWindow } = require('electron')
const { TitleBarButton } = require('electron-buttons').Main

// Wait until the app is ready
app.on('ready', () => {
    // Create a window
    const window = new BrowserWindow({
        width: 600,
        height: 500,
        frame: false,
        show: false,
        titleBarOverlay: {
            height: 40,
            color: '#ffffff',
            symbolColor: 'black'
        },
        titleBarStyle: 'hidden'
    })
    
    // Load a file or URL into the window
    window.loadFile('path-to-your-html-file-here')
    
    // Create a new TitleBarButton
    const button = new TitleBarButton(window, {
            id: 'button1',
            height: 40,
            icon: 'path-to-you-icon-here,
            color: '#aaaaaa',
            tryToAnalyse: true,
            buttonID: 'titleBarButton1'
        })
})

Installation

Follow the steps below to start using electron-buttons

  1. Install Node.js from https://nodejs.org/en/download/

  2. Install the electron-buttons dependency using npm

$ npm install electron-buttons@latest
  1. Require electron-buttons in the Main or Preload process, or otherwise in a process which has access to both Node and Electron APIs
const { TitleBarButton } = require('electron-buttons').Main
// Or depending on the process
const { TitleBarButton } = require('electron-buttons').Renderer

API

Currently work in progress.

Contributing Guidelines

Currently, contributions are not currently accepted until after the full release. If you have any suggestions, please create an issue with the enhancement label.

License

All code is licensed under the MIT License.

Features

  • Fully seamless creation of native-feeling titlebar buttons
  • Easy Customization due to a direct interface of the DOM Element
  • Event Listeners can be added easily
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago